Project

General

Profile

Bug #11299

csplit: NULL pointer errors

Added by Toomas Soome over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Build errors with NULL pointer:

    csplit.c: In function 'main':
    csplit.c:113:29: error: comparison between pointer and integer [-Werror]
         for (ptr = optarg; *ptr != NULL; ptr++)
                                 ^~
    csplit.c: In function 'asc_to_ll':
    csplit.c:224:14: error: comparison between pointer and integer [-Werror]
      for (; *str != NULL; str++)
                  ^~
    csplit.c: In function 'getfile':
    csplit.c:361:28: error: comparison between pointer and integer [-Werror]
        for (fptr = file; *fptr != NULL; fptr++)
                                ^~
    csplit.c: In function 'num_arg':
    csplit.c:457:12: error: comparison between pointer and integer [-Werror]
       if (*arg == NULL)
                ^~
    csplit.c:466:7: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      *ptr = NULL;
           ^
    csplit.c: In function 're_arg':
    csplit.c:505:12: error: comparison between pointer and integer [-Werror]
       if (*ptr == NULL)
                ^~
    csplit.c:519:7: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      *ptr = NULL;
           ^
    cc1: all warnings being treated as errors

#1

Updated by Electric Monk over 1 year ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 3d4dea7f235476fb40c0a6d84dcedfd04740f96b

commit  3d4dea7f235476fb40c0a6d84dcedfd04740f96b
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-06T22:28:16.000Z

    11299 csplit: NULL pointer errors
    Reviewed by: John Levon <john.levon@joyent.com>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Garrett D'Amore <garrett@damore.org>

Also available in: Atom PDF