X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_nameval.c;h=8d0fa4e565ed11f6157ac91f165ba3da30a710be;hp=18c30b3372c48f9cdf2a7c3c5a81f74b5df7d56f;hb=6500cebaa2c93512d544719956af259ca13f83b7;hpb=6120ba5a0a029e945f4a2e7e5955896f112d4adc diff --git a/yaffs_nameval.c b/yaffs_nameval.c index 18c30b3..8d0fa4e 100644 --- a/yaffs_nameval.c +++ b/yaffs_nameval.c @@ -37,8 +37,7 @@ static int nval_find(const char *xb, int xb_size, const YCHAR *name, memcpy(&size, xb, sizeof(int)); while (size > 0 && (size < xb_size) && (pos + size < xb_size)) { - if (strncmp - ((YCHAR *) (xb + pos + sizeof(int)), name, size) == 0) { + if (!strncmp((YCHAR *) (xb + pos + sizeof(int)), name, size)) { if (exist_size) *exist_size = size; return pos; @@ -152,12 +151,11 @@ int nval_get(const char *xb, int xb_size, const YCHAR * name, char *buf, memcpy(buf, xb + pos, size); return size; } - } if (pos >= 0) return -ERANGE; - else - return -ENODATA; + + return -ENODATA; } int nval_list(const char *xb, int xb_size, char *buf, int bsize)