X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=util%2Foid.c;h=f6d75376ffd7bd849b533bb63992f90208f4802d;hb=51a57f063cc48f3343ab59f10aab92b80d424eaf;hp=af20221427334b6491acc7936512fb78450cfa79;hpb=23cfa431fda52535722e4efdc3f462995937e863;p=yaz-moved-to-github.git diff --git a/util/oid.c b/util/oid.c index af20221..f6d7537 100644 --- a/util/oid.c +++ b/util/oid.c @@ -4,7 +4,13 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: oid.c,v $ - * Revision 1.28 1998-10-13 16:01:53 adam + * Revision 1.30 1998-10-18 07:48:56 adam + * Fixed oid_getentbyoid so that it returns NULL when parsed oid is NULL. + * + * Revision 1.29 1998/10/14 13:32:35 adam + * Added include of string.h. + * + * Revision 1.28 1998/10/13 16:01:53 adam * Implemented support for dynamic object identifiers. * Function oid_getvalbyname now accepts raw OID's as well as traditional * names. @@ -118,6 +124,7 @@ */ #include +#include #include #include @@ -412,8 +419,6 @@ static struct oident *oid_getentbyoid_x(int *o) struct oident_list *ol; /* determine protocol type */ - if (!o) - return 0; if ((prelen = match_prefix(o, z3950_prefix)) != 0) proto = PROTO_Z3950; else if ((prelen = match_prefix(o, sr_prefix)) != 0) @@ -513,6 +518,9 @@ struct oident *oid_addent (int *oid, int proto, int oclass, struct oident *oid_getentbyoid(int *oid) { struct oident *oident; + + if (!oid) + return 0; oid_init (); oident = oid_getentbyoid_x (oid); if (!oident)