diff options
author | Aaron M. Ucko <ucko@debian.org> | 2010-08-30 01:08:10 -0400 |
---|---|---|
committer | Aaron M. Ucko <ucko@debian.org> | 2010-08-30 01:08:10 -0400 |
commit | eb0fe75837f0b1ffd48822a16cf8cad5d056b911 (patch) | |
tree | 6f8696aaa90980b40dd2253289c858c1405a3d3b /object/objpub.c | |
parent | b4be7afc96f6bd0604ad7e6070c4baf8be8d808f (diff) |
Imported Upstream version 6.1.20100808
Diffstat (limited to 'object/objpub.c')
-rw-r--r-- | object/objpub.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/object/objpub.c b/object/objpub.c index e6ad239c..08315288 100644 --- a/object/objpub.c +++ b/object/objpub.c @@ -29,7 +29,7 @@ * * Version Creation Date: 4/1/91 * -* $Revision: 6.7 $ +* $Revision: 6.9 $ * * File Description: Object manager for module NCBI-Pub * @@ -41,6 +41,12 @@ * * * $Log: objpub.c,v $ +* Revision 6.9 2010/03/09 16:56:39 bollin +* Include Medline/PMID in Medline article formatting. +* +* Revision 6.8 2009/10/02 19:44:49 kans +* address clang static analyzer warnings +* * Revision 6.7 2005/12/29 13:46:18 bollin * added PubdescContentMatch function * @@ -536,8 +542,8 @@ NLM_EXTERN ValNodePtr LIBCALL PubAsnRead (AsnIoPtr aip, AsnTypePtr orig) DataVal av; AsnTypePtr atp; ValNodePtr anp=NULL; - Uint1 choice; - AsnReadFunc func; + Uint1 choice = 0; + AsnReadFunc func = NULL; if (! loaded) { @@ -628,7 +634,7 @@ NLM_EXTERN ValNodePtr LIBCALL PubAsnRead (AsnIoPtr aip, AsnTypePtr orig) } anp->choice = choice; - if ((choice != 4) && (choice != 13)) + if ((choice != 4) && (choice != 13) && func != NULL) { anp->data.ptrvalue = (* func)(aip, atp); if (anp->data.ptrvalue == NULL) goto erret; @@ -685,10 +691,10 @@ NLM_EXTERN ValNodePtr LIBCALL PubSetFree (ValNodePtr anp) NLM_EXTERN Boolean LIBCALL PubSetAsnWrite (ValNodePtr anp, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; - AsnTypePtr atp, settype, elementtype; + AsnTypePtr atp, settype = NULL, elementtype; Pointer pnt; Uint1 choice; - AsnWriteFunc func; + AsnWriteFunc func = NULL; ValNodePtr oldanp; Boolean retval = FALSE; @@ -760,7 +766,9 @@ NLM_EXTERN Boolean LIBCALL PubSetAsnWrite (ValNodePtr anp, AsnIoPtr aip, AsnType pnt = (Pointer)anp; else pnt = anp->data.ptrvalue; - if (! (*func)(pnt, aip, elementtype)) goto erret; + if (func != NULL) { + if (! (*func)(pnt, aip, elementtype)) goto erret; + } anp = anp->next; } @@ -1458,7 +1466,7 @@ NLM_EXTERN Int2 LIBCALL PubLabelUnique (ValNodePtr pub, CharPtr buf, Int2 buflen else sprintf(tbuf, "NLM%ld", (long)(mep->uid)); diff = LabelCopyExtra(buf, tbuf, buflen, NULL, " "); - buflen -= diff; + buflen -= diff; buf += diff; cap = mep->cit; goto cit_art; case PUB_Article: |