Project

General

Profile

Bug #11335

mailx: NULL pointer errors

Added by Toomas Soome 4 months ago. Updated 3 months ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Build errors with NULL pointer:

    list.c: In function 'getmessage':
    list.c:107:6: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      *ip = NULL;
          ^
    list.c: In function 'getmsglist':
    list.c:158:6: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      *ip = NULL;
          ^
    list.c: In function 'first':
    list.c:669:9: error: return makes integer from pointer without a cast [-Werror=int-conversion]
      return (NULL);
             ^

    lex.c: In function 'execute':
    lex.c:589:13: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
         *msgvec = NULL;
                 ^
    lex.c:593:15: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
         msgvec[1] = NULL;
                   ^
    lex.c:595:15: error: comparison between pointer and integer [-Werror]
       if (*msgvec == NULL) {
                   ^~

    collect.c: In function 'collect':
    collect.c:243:60: error: comparison between pointer and integer [-Werror]
       if ((nread = getaline(linebuf,LINESIZE,stdin,&hasnulls)) == NULL) {
                                                                ^~
    collect.c: In function 'forward':
    collect.c:1091:14: error: comparison between pointer and integer [-Werror]
      if (*msgvec == NULL) {
                  ^~
    collect.c:1093:15: error: comparison between pointer and integer [-Werror]
       if (*msgvec == NULL) {
                   ^~
    collect.c:1097:13: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       msgvec[1] = NULL;
                 ^
    collect.c:1102:24: error: comparison between pointer and integer [-Werror]
      for (ip = msgvec; *ip != NULL; ip++) {
                            ^~

    cmd4.c: In function 'dopipe':
    cmd4.c:88:15: error: comparison between pointer and integer [-Werror]
       if (*msgvec == NULL) {
                   ^~
    cmd4.c:92:13: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       msgvec[1] = NULL;
                 ^
    cmd4.c: In function 'loadmsg':
    cmd4.c:208:15: error: comparison between pointer and integer [-Werror]
       if (*msgvec == NULL) {
                   ^~
    cmd4.c:212:13: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       msgvec[1] = NULL;
                 ^
    cmd4.c:216:16: error: comparison between pointer and integer [-Werror]
      if (msgvec[1] != NULL) {
                    ^~
    cmd4.c: In function 'field':
    cmd4.c:284:15: error: comparison between pointer and integer [-Werror]
       if (*msgvec == NULL) {
                   ^~
    cmd4.c:288:13: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       msgvec[1] = NULL;
                 ^

    cmd3.c: In function 'preserve':
    cmd3.c:469:24: error: comparison between pointer and integer [-Werror]
      for (ip = msgvec; *ip != NULL; ip++) {
                            ^~
    cmd3.c: In function 'unread':
    cmd3.c:487:24: error: comparison between pointer and integer [-Werror]
      for (ip = msgvec; *ip != NULL; ip++) {
                            ^~
    cmd3.c: In function 'messize':
    cmd3.c:505:24: error: comparison between pointer and integer [-Werror]
      for (ip = msgvec; *ip != NULL; ip++) {
                            ^~

    cmd2.c: In function 'next':
    cmd2.c:78:14: error: comparison between pointer and integer [-Werror]
      if (*msgvec != NULL) {
                  ^~
    cmd2.c:116:10: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      list[1] = NULL;
              ^
    cmd2.c: In function 'save1':
    cmd2.c:157:15: error: comparison between pointer and integer [-Werror]
       if (*msgvec == NULL) {
                   ^~
    cmd2.c:161:13: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       msgvec[1] = NULL;
                 ^
    cmd2.c: In function 'put1':
    cmd2.c:232:15: error: comparison between pointer and integer [-Werror]
       if (*msgvec == NULL) {
                   ^~
    cmd2.c:236:13: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       msgvec[1] = NULL;
                 ^
    cmd2.c: In function 'swrite':
    cmd2.c:377:15: error: comparison between pointer and integer [-Werror]
       if (*msgvec == NULL) {
                   ^~
    cmd2.c:381:13: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       msgvec[1] = NULL;
                 ^
    cmd2.c: In function 'deltype':
    cmd2.c:533:12: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
        list[1] = NULL;
                ^
    cmd2.c: In function 'delm':
    cmd2.c:555:7: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
      last = NULL;
           ^
    cmd2.c:556:24: error: comparison between pointer and integer [-Werror]
      for (ip = msgvec; *ip != NULL; ip++) {
                            ^~
    cmd2.c:564:11: error: comparison between pointer and integer [-Werror]
      if (last != NULL) {
               ^~
    cmd2.c:567:12: error: comparison between pointer and integer [-Werror]
       if (last != NULL) {
                ^~

    cmd1.c: In function 'from':
    cmd1.c:197:24: error: comparison between pointer and integer [-Werror]
      for (ip = msgvec; *ip != NULL; ip++) {
                            ^~
    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk 3 months ago

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

git commit 46d64c14791e94efc5b1534ccf8db76ed1fadcfc

commit  46d64c14791e94efc5b1534ccf8db76ed1fadcfc
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-11T15:08:37.000Z

    11335 mailx: NULL pointer errors
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF