summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-10-12 14:54:29 +0200
committerJohn Crispin <blogic@openwrt.org>2014-10-12 15:01:47 +0200
commitb9a389c841db8433bb3b02158b1512cf577dbff7 (patch)
treef9e3b37b5900c319826bf6374efa0d3653291cce /utils
parente63051d9843ddbafb1fabfd97d60e853bdeac129 (diff)
downloadunitd-b9a389c841db8433bb3b02158b1512cf577dbff7.tar
unitd-b9a389c841db8433bb3b02158b1512cf577dbff7.zip
minor fixes to michels patches
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'utils')
-rw-r--r--utils/utils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/utils/utils.c b/utils/utils.c
index 5e67310..a8c2a91 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -149,16 +149,16 @@ char* get_cmdline_val(const char* name, char* out, int len)
close(fd);
sprintf( pattern, "%s=([^ \n]*)", name);
- regcomp(&pat_cmdline, pattern, REG_EXTENDED);
- if (!regexec(&pat_cmdline, line, 2, matches, 0)) {
- line[matches[1].rm_eo] = '\0';
+ regcomp(&pat_cmdline, pattern, REG_EXTENDED);
+ if (!regexec(&pat_cmdline, line, 2, matches, 0)) {
+ line[matches[1].rm_eo] = '\0';
tty = (line + matches[1].rm_so);
strncpy(out, tty, len);
tty[len-1] = '\0';
res = out;
}
- regfree(&pat_cmdline);
+ regfree(&pat_cmdline);
return res;
}