summaryrefslogtreecommitdiffstats
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)
return false;
*name = line;
- *ptr = 0;
+ *ptr = '\0'; /* terminate previous */
ptr++;
ptr = skip_whitespace(ptr);
*value = ptr;
/* strip whitespace from the right side of value */
ptr += strlen(ptr);
- for (ptr--; ptr >= *value; ptr--)
+ ptr--;
+ while ((ptr > (*value) - 1) && isspace(*ptr))
{
- if (isspace(*ptr))
- *ptr = '\0';
+ *ptr = '\0';
+ ptr--;
}
return true;