Check-in Number:
|
3640 | |
Date: |
2003-Oct-13 15:35:51 (local)
2003-Oct-13 13:35:51 (UTC) |
User: | thl |
Branch: | |
Comment: |
remove unused filename; revamp while() into for() and repeat for cleanup sequence |
Tickets: |
|
Inspections: |
|
Files: |
|
ossp-pkg/fsl/fsl.c 1.63 -> 1.64
--- fsl.c 2003/10/13 13:18:28 1.63
+++ fsl.c 2003/10/13 13:35:51 1.64
@@ -394,7 +394,6 @@
fsl_rc_t rc;
DIR *dp = NULL;
struct dirent *de;
- char *filename = NULL;
char *cfgdir;
char *prefix;
char **filearr = NULL;
@@ -437,19 +436,18 @@
}
}
qsort((void *)filearr, (size_t)filecnt, sizeof(char *), fnamecmp);
- while (fileidx < filecnt) { /* loop once for every string in sorted array */
+ for (fileidx = 0; fileidx < filecnt; fileidx++)
if (appendfiletobuffer(buffer, filearr[fileidx]) == FSL_OK)
rc = FSL_OK;
- free(filearr[fileidx]);
- filearr[fileidx] = NULL;
- fileidx++;
- }
CU(rc);
CUS:
if (dp != NULL)
closedir(dp);
- if (filename != NULL)
- free(filename);
+ if (filearr != NULL) {
+ for (fileidx = 0; fileidx < filecnt; fileidx++)
+ free(filearr[fileidx]);
+ free(filearr);
+ }
return rc;
}
|
|