浏览代码

getsubopt: don't include leading = in value string

getsubopt incorrectly returns the delimiting = in the value string,
this patch fixes it by increasing the pointer position by one.

Signed-off-by: Steven Barth <[email protected]>
Steven Barth 9 年之前
父节点
当前提交
aa71ec3db8
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/misc/getsubopt.c

+ 1 - 1
src/misc/getsubopt.c

@@ -15,7 +15,7 @@ int getsubopt(char **opt, char *const *keys, char **val)
 		size_t l = strlen(keys[i]);
 		if (strncmp(keys[i], s, l)) continue;
 		if (s[l] == '=')
-			*val = s + l;
+			*val = s + l + 1;
 		else if (s[l]) continue;
 		return i;
 	}