Skip to content

Commit

Permalink
Fix C compiler warning about wrong % format specifier
Browse files Browse the repository at this point in the history
```
ext/clocale/clocale.c:53:80: warning: format specifies type 'unsigned int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
      if (buf == NULL) rb_raise(rb_eNoMemError, "could not allocate %u bytes", size);
                                                                    ~~         ^~~~
                                                                    %zu
```
  • Loading branch information
avdv committed Aug 9, 2018
1 parent bbff802 commit 5103822
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ext/clocale/clocale.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ lc_strxfrm(VALUE self, VALUE str) {
size = needed + 1;
buf = realloc(buf, size);

if (buf == NULL) rb_raise(rb_eNoMemError, "could not allocate %u bytes", size);
if (buf == NULL) rb_raise(rb_eNoMemError, "could not allocate %zu bytes", size);
}
}

Expand Down

0 comments on commit 5103822

Please sign in to comment.