Skip to content

Commit

Permalink
Fix nk_strtoi() const type usage (#740)
Browse files Browse the repository at this point in the history
This fixes `nk_strtoi()` expecting a `char**`, but getting a `const char**`.
  • Loading branch information
RobLoach authored Nov 20, 2024
1 parent 628fa63 commit 22b712b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions nuklear.h
Original file line number Diff line number Diff line change
Expand Up @@ -7415,7 +7415,7 @@ nk_vsnprintf(char *buf, int buf_size, const char *fmt, va_list args)
/* width argument */
width = NK_DEFAULT;
if (*iter >= '1' && *iter <= '9') {
const char *end;
char *end;
width = nk_strtoi(iter, &end);
if (end == iter)
width = -1;
Expand All @@ -7433,7 +7433,7 @@ nk_vsnprintf(char *buf, int buf_size, const char *fmt, va_list args)
precision = va_arg(args, int);
iter++;
} else {
const char *end;
char *end;
precision = nk_strtoi(iter, &end);
if (end == iter)
precision = -1;
Expand Down
4 changes: 2 additions & 2 deletions src/nuklear_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ nk_vsnprintf(char *buf, int buf_size, const char *fmt, va_list args)
/* width argument */
width = NK_DEFAULT;
if (*iter >= '1' && *iter <= '9') {
const char *end;
char *end;
width = nk_strtoi(iter, &end);
if (end == iter)
width = -1;
Expand All @@ -651,7 +651,7 @@ nk_vsnprintf(char *buf, int buf_size, const char *fmt, va_list args)
precision = va_arg(args, int);
iter++;
} else {
const char *end;
char *end;
precision = nk_strtoi(iter, &end);
if (end == iter)
precision = -1;
Expand Down

0 comments on commit 22b712b

Please sign in to comment.