diff options
Diffstat (limited to 'apps/plugins/lua/lstrlib.c')
-rw-r--r-- | apps/plugins/lua/lstrlib.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/apps/plugins/lua/lstrlib.c b/apps/plugins/lua/lstrlib.c index 3d6103692f..4d58280ba8 100644 --- a/apps/plugins/lua/lstrlib.c +++ b/apps/plugins/lua/lstrlib.c | |||
@@ -737,9 +737,7 @@ static const char *scanformat (lua_State *L, const char *strfrmt, char *form) { | |||
737 | if (isdigit(uchar(*p))) | 737 | if (isdigit(uchar(*p))) |
738 | luaL_error(L, "invalid format (width or precision too long)"); | 738 | luaL_error(L, "invalid format (width or precision too long)"); |
739 | *(form++) = '%'; | 739 | *(form++) = '%'; |
740 | strncpy(form, strfrmt, p - strfrmt + 1); | 740 | strlcpy(form, strfrmt, p - strfrmt + 1); |
741 | form += p - strfrmt + 1; | ||
742 | *form = '\0'; | ||
743 | return p; | 741 | return p; |
744 | } | 742 | } |
745 | 743 | ||