Change-Id: Idbc8006317e121ebd884642a06c3cd03a9811b63
Signed-off-by: shingil.kang <shingil.kang@samsung.com>
Name: sdbd
Summary: SDB daemon
-Version: 3.0.2
+Version: 3.0.3
Release: 0
License: Apache-2.0
Summary: SDB daemon
s = buf;
e = buf + (strlen(buf) - 1);
+ // trim string
while(*e == ' ' || *e == '\n' || *e == '\t') {
e--;
}
s++;
}
+ // skip comment or null string
if (*s == '#' || *s == '\0') {
continue;
}
*value++ = '\0';
if(!strcmp(buf, key)) {
- *env = value;
+ *env = strdup(value);
break;
}
}
envp[3] = path;
free(trim_value);
} else {
- envp[3] = value;
+ snprintf(path, sizeof(path), "%s", value);
+ envp[3] = path;
}
+ free(value);
}
D("path env:%s,%s,%s,%s\n", envp[0], envp[1], envp[2], envp[3]);