summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-09-12 13:32:31 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-09-12 13:33:22 +0300
commit3226c2073a71818ab45de6784840ccdc28d07b46 (patch)
treedded46644babee3619119e3cdbbbdec2dc2b651e /rpmio
parentbed3880ef1aac914970a712ed295dad68947bb7d (diff)
downloadlibrpm-tizen-3226c2073a71818ab45de6784840ccdc28d07b46.tar.gz
librpm-tizen-3226c2073a71818ab45de6784840ccdc28d07b46.tar.bz2
librpm-tizen-3226c2073a71818ab45de6784840ccdc28d07b46.zip
String pool id 0 equals NULL
- Pool id 0 is special case for "not found". Return an actual NULL instead of an empty string.
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/rpmstrpool.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/rpmio/rpmstrpool.c b/rpmio/rpmstrpool.c
index 1eb379ada..38b676c03 100644
--- a/rpmio/rpmstrpool.c
+++ b/rpmio/rpmstrpool.c
@@ -146,7 +146,7 @@ rpmsid rpmstrPoolId(rpmstrPool pool, const char *s, int create)
const char * rpmstrPoolStr(rpmstrPool pool, rpmsid sid)
{
const char *s = NULL;
- if (pool && sid <= pool->offs_size)
+ if (pool && sid > 0 && sid <= pool->offs_size)
s = pool->data + pool->offs[sid];
return s;
}