From e322805021ccc1648125fd83e8c7b0959ece26f8 Mon Sep 17 00:00:00 2001 From: "B. Lachele Foley" Date: Sun, 17 Mar 2024 23:09:13 -0400 Subject: [PATCH] Removed old-style null reference. Code now compiles for C and for C++ --- src/PDB/writePDB.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PDB/writePDB.c b/src/PDB/writePDB.c index 960b472..427ffd9 100644 --- a/src/PDB/writePDB.c +++ b/src/PDB/writePDB.c @@ -415,8 +415,8 @@ strcat(line," "); /* pdb_a[2].b[1].c[7] = 1; chainID (22) */ -if((a[0].cID!='\0')&&(a[0].cID!=NULL)){strncat(line,a[0].cID,1);} -else if((r[0].cID!='\0')&&(a[0].cID!=NULL)){strncat(line,r[0].cID,1);} +if(a[0].cID!=NULL){strncat(line,a[0].cID,1);} +else if(a[0].cID!=NULL){strncat(line,r[0].cID,1);} else{strcat(line," ");} /* pdb_a[2].b[1].c[8] = 4; resSeq (23-26) @@ -429,7 +429,7 @@ strcat(line,tmp); /* pdb_a[2].b[1].c[9] = 1; iCode (27) */ -if(r[0].IC=='\0'){strcat(line," ");} +if(r[0].IC==NULL){strcat(line," ");} else{strncat(line,r[0].IC,1);} /* pdb_a[2].b[1].c[10] = 3; N/A (28-30)