Project

General

Profile

Bug #11440

tar: NULL pointer errors

Added by Toomas Soome 5 days ago.

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

90%

Estimated time:
Difficulty:
Medium
Tags:

Description

Build errors with NULL pointer:

    tar.c: In function 'convtoreg':
    tar.c:2703:28: error: comparison between pointer and integer [-Werror]
          (dblock.dbuf.typeflag != NULL) && (dblock.dbuf.typeflag != '1') &&
                                ^~
    tar.c: In function 'doxtract':
    tar.c:3216:15: error: comparison between pointer and integer [-Werror]
        if (*linkp !=  NULL) {
                   ^~
    tar.c:3257:15: error: comparison between pointer and integer [-Werror]
        if (*linkp != NULL) {
                   ^~
    tar.c:3306:15: error: comparison between pointer and integer [-Werror]
        if (*linkp != NULL) {
                   ^~
    tar.c:3446:28: error: comparison between pointer and integer [-Werror]
           dblock.dbuf.typeflag == NULL || convflag) {
                                ^~
    tar.c:3449:15: error: comparison between pointer and integer [-Werror]
        if (*linkp != NULL) {
                   ^~
    tar.c:3655:28: error: comparison between pointer and integer [-Werror]
           dblock.dbuf.typeflag == NULL ||
                                ^~
    tar.c: In function 'add_file_to_table':
    tar.c:5529:26: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       name[strlen(name) - 1] = NULL;
                              ^
    tar.c: In function 'is_in_table':
    tar.c:5567:26: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       name[strlen(name) - 1] = NULL;
                              ^
    tar.c:5586:8: error: assignment makes integer from pointer without a cast [-Werror=int-conversion]
       *ptr = NULL;
            ^
    tar.c: In function 'delete_target':
    tar.c:6664:15: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
          buf[n] = (char)NULL;
                   ^
    cc1: all warnings being treated as errors

Also available in: Atom PDF