From 643728aca42b3aa3c404a539cf6ed6558546d110 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 1 Jul 2010 16:43:28 +0000 Subject: [PATCH] explicit compare with NULL --- ChangeLog | 11 +++++++---- src/frontend/inpcom.c | 10 +++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 715ed0a29..47e5a720d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,11 @@ +2010-07-01 Robert Larice + * src/frontend/inpcom.c : explicit compare with NULL + 2010-06-30 Robert Larice - * src/frontend/com_ahelp.c : drop NULL casting - * src/frontend/com_measure2.c : dont mix enum with integer - * src/include/inpptree.h : add parameter-names to a prototype - * src/spicelib/parser/ptfuncs.c : add casts to anonymous data + * src/frontend/com_ahelp.c : drop NULL casting + * src/frontend/com_measure2.c : dont mix enum with integer + * src/include/inpptree.h : add parameter-names to a prototype + * src/spicelib/parser/ptfuncs.c : add casts to anonymous data 2010-06-30 Holger Vogt * inpcom.c: no braces in let, set commands inside control loop diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index f0bb74d59..39b5f6945 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -3584,7 +3584,7 @@ static void inp_compat(struct line *deck) if ( *curr_line == 'e' ) { /* Exxx n1 n2 VCVS n3 n4 gain --> Exxx n1 n2 n3 n4 gain remove vcvs */ - if (str_ptr = strstr( curr_line, "vcvs" ) ) { + if ((str_ptr = strstr( curr_line, "vcvs" )) != NULL) { *str_ptr = ' '; *(str_ptr + 1) = ' '; *(str_ptr + 2) = ' '; *(str_ptr + 3) = ' '; } @@ -3594,7 +3594,7 @@ static void inp_compat(struct line *deck) Exxx n1 n2 int1 0 1 BExxx int1 0 V = {equation} */ - if (str_ptr = strstr( curr_line, "vol" ) ) { + if ((str_ptr = strstr( curr_line, "vol" )) != NULL) { cut_line = curr_line; /* title and nodes */ title_tok = gettok(&cut_line); @@ -3650,7 +3650,7 @@ static void inp_compat(struct line *deck) else if ( *curr_line == 'g' ) { /* Gxxx n1 n2 VCCS n3 n4 tr --> Gxxx n1 n2 n3 n4 tr remove vccs */ - if (str_ptr = strstr( curr_line, "vccs" ) ) { + if ((str_ptr = strstr( curr_line, "vccs" )) != NULL) { *str_ptr = ' '; *(str_ptr + 1) = ' '; *(str_ptr + 2) = ' '; *(str_ptr + 3) = ' '; } @@ -3661,7 +3661,7 @@ static void inp_compat(struct line *deck) Gxxx n1 n2 int1 0 1 BGxxx int1 0 V = {equation} */ - if (str_ptr = strstr( curr_line, "cur" ) ) { + if ((str_ptr = strstr( curr_line, "cur" )) != NULL) { cut_line = curr_line; /* title and nodes */ title_tok = gettok(&cut_line); @@ -3928,7 +3928,7 @@ static void inp_bsource_compat(struct line *deck) /* store starting point for later parsing, beginning of {expression} */ equal_ptr = strstr(curr_line, "="); /* find the m={m} token and remove it */ - if(str_ptr = strstr(curr_line, "m={m}")) + if((str_ptr = strstr(curr_line, "m={m}")) != NULL) memcpy( str_ptr, " ", 5 ); /* scan the line and remove all '{' and '}' */ str_ptr = curr_line;