diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2011-10-07 21:53:56 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2011-10-07 21:53:56 -0500 |
commit | c937997abd00451bd9b652083a34dd9027edb96a (patch) | |
tree | 42bd28670673aaebd87c6553bd6f2612dadd7f11 /soltools/javadep | |
parent | improve error messages for sc's filters-test (diff) | |
download | core-c937997abd00451bd9b652083a34dd9027edb96a.tar.gz core-c937997abd00451bd9b652083a34dd9027edb96a.zip |
Revert "cppcheck scope reduction of var in soltools/...javadep.c"
This reverts commit 1fc34c75a8a2356ed03c52ca839a7ad771c51ba1.
which break windows by using c99 features... and Redmond
only support the 22 year old standard c89.
Diffstat (limited to 'soltools/javadep')
-rw-r--r-- | soltools/javadep/javadep.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/soltools/javadep/javadep.c b/soltools/javadep/javadep.c index ced9f3842df3..351177a76c6c 100644 --- a/soltools/javadep/javadep.c +++ b/soltools/javadep/javadep.c @@ -198,13 +198,15 @@ read_utf8(const file_t *pfile) * Data is still in network byteorder */ - utf8_t a_utf8; + utf8_t a_utf8; + size_t nread; + a_utf8.pdata = NULL; a_utf8.nlen = read_uint16(pfile); if (a_utf8.nlen > 0) { a_utf8.pdata = xmalloc(a_utf8.nlen*sizeof(char)); - size_t nread = fread(a_utf8.pdata, a_utf8.nlen*sizeof(char), 1, pfile->pfs); + nread = fread(a_utf8.pdata, a_utf8.nlen*sizeof(char), 1, pfile->pfs); if ( !nread ) { fclose(pfile->pfs); err_quit("%s: truncated class file", pfile->pname); @@ -263,7 +265,8 @@ add_to_dependencies(struct growable *pdep, const char *pclass_file) { /* create dependencies */ - size_t nlen_pdepstr; + int i; + size_t nlen_filt, nlen_str, nlen_pdepstr; char *pstr, *ptrunc; char path[PATH_MAX+1]; char cnp_class_file[PATH_MAX+1]; @@ -279,10 +282,9 @@ add_to_dependencies(struct growable *pdep, append_to_growable(pdep, strdup(pstr)); } } else { - size_t nlen_str = strlen(pstr); - int i; + nlen_str = strlen(pstr); for ( i = 0; i < pfilt->ncur; i++ ) { - size_t nlen_filt = strlen(pfilt->parray[i]); + nlen_filt = strlen(pfilt->parray[i]); if ( nlen_filt + 1 + nlen_str > PATH_MAX ) err_quit("path to long"); memcpy(path, pfilt->parray[i], nlen_filt); |