X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=odr%2Fodr_util.c;h=cfa28cc38fc3ddd7b95c5d631f1ce86c2e400469;hb=113640450c45ca7ac96285cc8ca666bfd597ed21;hp=ed3b07e6226f23ab6df59f0b134ef2cff81e238c;hpb=d5841c7c5616c3259c78e90cbf8e5e96ebd3ab31;p=yaz-moved-to-github.git diff --git a/odr/odr_util.c b/odr/odr_util.c index ed3b07e..cfa28cc 100644 --- a/odr/odr_util.c +++ b/odr/odr_util.c @@ -57,10 +57,11 @@ Odr_oid *odr_getoidbystr(ODR o, char *str) return 0; while ((p = strchr(p, '.'))) num++, p++; - ret = odr_malloc(o, sizeof(*ret)*num); + ret = odr_malloc(o, sizeof(*ret)*(num + 1)); p = str; do ret[i++] = atoi(p); - while ((p = strchr(p, '.'))); + while ((p = strchr(p, '.')) && ++p); + ret[i] = -1; return ret; }