aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/files.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/files.c')
-rw-r--r--networking/udhcp/files.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/networking/udhcp/files.c b/networking/udhcp/files.c
index fe853c7cc..d2ca2363f 100644
--- a/networking/udhcp/files.c
+++ b/networking/udhcp/files.c
@@ -241,9 +241,7 @@ static int read_staticlease(const char *const_line, void *arg)
241 241
242 addStaticLease(arg, mac_bytes, ip); 242 addStaticLease(arg, mac_bytes, ip);
243 243
244#ifdef UDHCP_DEBUG 244 if (ENABLE_FEATURE_UDHCP_DEBUG) printStaticLeases(arg);
245 printStaticLeases(arg);
246#endif
247 245
248 return 1; 246 return 1;
249 247
@@ -280,9 +278,6 @@ int read_config(const char *file)
280{ 278{
281 FILE *in; 279 FILE *in;
282 char buffer[READ_CONFIG_BUF_SIZE], *token, *line; 280 char buffer[READ_CONFIG_BUF_SIZE], *token, *line;
283#ifdef UDHCP_DEBUG
284 char orig[READ_CONFIG_BUF_SIZE];
285#endif
286 int i, lm = 0; 281 int i, lm = 0;
287 282
288 for (i = 0; keywords[i].keyword[0]; i++) 283 for (i = 0; keywords[i].keyword[0]; i++)
@@ -295,11 +290,11 @@ int read_config(const char *file)
295 } 290 }
296 291
297 while (fgets(buffer, READ_CONFIG_BUF_SIZE, in)) { 292 while (fgets(buffer, READ_CONFIG_BUF_SIZE, in)) {
293 char debug_orig[READ_CONFIG_BUF_SIZE];
294
298 lm++; 295 lm++;
299 if (strchr(buffer, '\n')) *(strchr(buffer, '\n')) = '\0'; 296 if (strchr(buffer, '\n')) *(strchr(buffer, '\n')) = '\0';
300#ifdef UDHCP_DEBUG 297 if (ENABLE_FEATURE_UDHCP_DEBUG) strcpy(debug_orig, buffer);
301 strcpy(orig, buffer);
302#endif
303 if (strchr(buffer, '#')) *(strchr(buffer, '#')) = '\0'; 298 if (strchr(buffer, '#')) *(strchr(buffer, '#')) = '\0';
304 299
305 if (!(token = strtok(buffer, " \t"))) continue; 300 if (!(token = strtok(buffer, " \t"))) continue;
@@ -315,7 +310,7 @@ int read_config(const char *file)
315 if (!strcasecmp(token, keywords[i].keyword)) 310 if (!strcasecmp(token, keywords[i].keyword))
316 if (!keywords[i].handler(line, keywords[i].var)) { 311 if (!keywords[i].handler(line, keywords[i].var)) {
317 LOG(LOG_ERR, "Failure parsing line %d of %s", lm, file); 312 LOG(LOG_ERR, "Failure parsing line %d of %s", lm, file);
318 DEBUG(LOG_ERR, "unable to parse '%s'", orig); 313 DEBUG(LOG_ERR, "unable to parse '%s'", debug_orig);
319 /* reset back to the default value */ 314 /* reset back to the default value */
320 keywords[i].handler(keywords[i].def, keywords[i].var); 315 keywords[i].handler(keywords[i].def, keywords[i].var);
321 } 316 }