aboutsummaryrefslogtreecommitdiff
path: root/src/main/extractor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/extractor.c')
-rw-r--r--src/main/extractor.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/extractor.c b/src/main/extractor.c
index fe379be..800fb22 100644
--- a/src/main/extractor.c
+++ b/src/main/extractor.c
@@ -1170,6 +1170,8 @@ process_requests (struct EXTRACTOR_PluginList *plugin,
1170{ 1170{
1171 char hfn[256]; 1171 char hfn[256];
1172 char tfn[256]; 1172 char tfn[256];
1173 size_t hfn_len;
1174 size_t tfn_len;
1173 char *fn; 1175 char *fn;
1174 FILE *fin; 1176 FILE *fin;
1175 void *ptr; 1177 void *ptr;
@@ -1228,17 +1230,19 @@ process_requests (struct EXTRACTOR_PluginList *plugin,
1228 } 1230 }
1229 while (NULL != fgets (hfn, sizeof(hfn), fin)) 1231 while (NULL != fgets (hfn, sizeof(hfn), fin))
1230 { 1232 {
1231 if (strlen (hfn) <= 1) 1233 hfn_len = strlen (hfn);
1234 if (hfn_len <= 1)
1232 break; 1235 break;
1233 ptr = NULL; 1236 ptr = NULL;
1234 hfn[strlen(hfn)-1] = '\0'; /* kill newline */ 1237 hfn[--hfn_len] = '\0'; /* kill newline */
1235 if (NULL == fgets (tfn, sizeof(tfn), fin)) 1238 if (NULL == fgets (tfn, sizeof(tfn), fin))
1236 break; 1239 break;
1237 if ('!' != tfn[0]) 1240 if ('!' != tfn[0])
1238 break; 1241 break;
1239 tfn[strlen(tfn)-1] = '\0'; /* kill newline */ 1242 tfn_len = strlen (tfn);
1243 tfn[--tfn_len] = '\0'; /* kill newline */
1240 if ( (want_tail) && 1244 if ( (want_tail) &&
1241 (strlen (tfn) > 1) ) 1245 (tfn_len > 1) )
1242 { 1246 {
1243 fn = &tfn[1]; 1247 fn = &tfn[1];
1244 } 1248 }