summaryrefslogtreecommitdiff
path: root/apps/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/misc.c')
-rw-r--r--apps/misc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/misc.c b/apps/misc.c
index 63a3a2a6eb..950662d19a 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -268,17 +268,18 @@ bool settings_parseline(char* line, char** name, char** value)
268 return false; 268 return false;
269 269
270 *name = line; 270 *name = line;
271 *ptr = 0; 271 *ptr = '\0'; /* terminate previous */
272 ptr++; 272 ptr++;
273 ptr = skip_whitespace(ptr); 273 ptr = skip_whitespace(ptr);
274 *value = ptr; 274 *value = ptr;
275 275
276 /* strip whitespace from the right side of value */ 276 /* strip whitespace from the right side of value */
277 ptr += strlen(ptr); 277 ptr += strlen(ptr);
278 for (ptr--; ptr >= *value; ptr--) 278 ptr--;
279 while ((ptr > (*value) - 1) && isspace(*ptr))
279 { 280 {
280 if (isspace(*ptr)) 281 *ptr = '\0';
281 *ptr = '\0'; 282 ptr--;
282 } 283 }
283 284
284 return true; 285 return true;