aboutsummaryrefslogtreecommitdiffstats
path: root/src/wgtpkg-install.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-09-12 14:08:33 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2016-09-12 14:08:33 +0200
commit5b74cd6f2b5cdd82273759aa7d72150dfff58a2c (patch)
tree3c589f9487e693f9287b89eeb2fc10a8af651ce1 /src/wgtpkg-install.c
parent628dc10767d95436538391534dc3c95f45fe9a3a (diff)
add documentation & ideas about config.xml
Also enforce the strings for 'id' and 'version' to be not empty in config.xml Change-Id: I510b62891885033e0b750fac5f5de5e0fd25d75d Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/wgtpkg-install.c')
-rw-r--r--src/wgtpkg-install.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/wgtpkg-install.c b/src/wgtpkg-install.c
index 264606a..7d0c318 100644
--- a/src/wgtpkg-install.c
+++ b/src/wgtpkg-install.c
@@ -56,14 +56,19 @@ static int check_valid_string(const char *value, const char *name)
return -1;
pos = 0;
c = value[pos];
- while(c) {
+ if (c == 0) {
+ ERROR("empty string forbidden in '%s' (temporary constraints)", name);
+ errno = EINVAL;
+ return -1;
+ }
+ do {
if (!isalnum(c) && !strchr(".-_", c)) {
ERROR("forbidden char %c in '%s' -> '%s' (temporary constraints)", c, name, value);
errno = EINVAL;
return -1;
}
c = value[++pos];
- }
+ } while(c);
return 0;
}