X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_nameval.c;h=487b03e19fd9a6f0fb06800f7dde867602ccdc16;hp=e75411be9fb7dfef4e3f6866347a35cc88140881;hb=7715144e7d55b2854f907001c432348e4caa5954;hpb=2c98f380f6e28ef71d4d7a8a174cc22b0481f102 diff --git a/yaffs_nameval.c b/yaffs_nameval.c index e75411b..487b03e 100644 --- a/yaffs_nameval.c +++ b/yaffs_nameval.c @@ -146,6 +146,12 @@ int nval_get(const char *xb, int xb_size, const YCHAR * name, char *buf, pos++; size--; + /* If bsize is zero then this is a size query. + * Return the size, but don't copy. + */ + if (!bsize) + return size; + if (size <= bsize) { memcpy(buf, xb + pos, size); return size;