Skip to content

Wrong size in snprintf in uncertain_upe.c #171

Open
@phillipstanleymarbell

Description

@phillipstanleymarbell

Wrong size in snprintf in uncertain_upe.c:

uncertain_upe.c:589:49: warning: ‘%-*d’ directive output truncated writing between 5 and 11 bytes into a region of size 4 [-Wformat-truncation=]
  result = snprintf(buffer, PRINT_DIGITS + 1, " u%-*d", PRINT_DIGITS, row);
                                                 ^~~~
uncertain_upe.c:589:9: note: ‘snprintf’ output between 8 and 14 bytes into a destination of size 6
  result = snprintf(buffer, PRINT_DIGITS + 1, " u%-*d", PRINT_DIGITS, row);
  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uncertain_upe.c:614:49: warning: ‘%#-*.*f’ directive output truncated writing between 7 and 316 bytes into a region of size 6 [-Wformat-truncation=]
    result = snprintf(buffer, PRINT_DIGITS + 1, "%#-*.*f",
                                                 ^~~~~~~
uncertain_upe.c:614:11: note: ‘snprintf’ output between 8 and 317 bytes into a destination of size 6
    result = snprintf(buffer, PRINT_DIGITS + 1, "%#-*.*f",
    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        PRINT_DIGITS, PRINT_DIGITS, var);
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
uncertain_upe.c:630:50: warning: ‘%#-*.*f’ directive output truncated writing between 7 and 316 bytes into a region of size 6 [-Wformat-truncation=]
     result = snprintf(buffer, PRINT_DIGITS + 1, "%#-*.*f",
                                                  ^~~~~~~
uncertain_upe.c:630:12: note: ‘snprintf’ output between 8 and 317 bytes into a destination of size 6
     result = snprintf(buffer, PRINT_DIGITS + 1, "%#-*.*f",
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         PRINT_DIGITS, PRINT_DIGITS, covar);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions