aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lemon
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2018-04-01 21:59:33 +0200
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2018-04-05 18:51:34 +0000
commit02ef13fac7309244436100853d78bc03b21f4a42 (patch)
treef9c344b8dc446323314ead50e970e9f5eaf04cf2 /tools/lemon
parentc462fa89361913731caf5496c65b418c97b8158a (diff)
lemon: remove scan-build warning in errline().
Warning: Argument with 'nonnull' attribute passed null. Change-Id: Ie46733ae8663161b957acaabbaa2da539018693d Reviewed-on: https://code.wireshark.org/review/26704 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'tools/lemon')
-rw-r--r--tools/lemon/lemon.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/lemon/lemon.c b/tools/lemon/lemon.c
index 5404a19c12..64e4179f28 100644
--- a/tools/lemon/lemon.c
+++ b/tools/lemon/lemon.c
@@ -1964,9 +1964,11 @@ static FILE *errstream;
*/
static void errline(int n, int k, FILE *err)
{
- int spcnt, i;
- if( argv[0] ) fprintf(err,"%s",argv[0]);
- spcnt = lemonStrlen(argv[0]) + 1;
+ int spcnt = 0, i;
+ if( argv[0] ) {
+ fprintf(err,"%s",argv[0]);
+ spcnt = lemonStrlen(argv[0]) + 1;
+ }
for(i=1; i<n && argv[i]; i++){
fprintf(err," %s",argv[i]);
spcnt += lemonStrlen(argv[i])+1;