** add length modifier into formats */
| 1038 | ** add length modifier into formats |
| 1039 | */ |
| 1040 | static void addlenmod(char *form, const char *lenmod) { |
| 1041 | size_t l = strlen(form); |
| 1042 | size_t lm = strlen(lenmod); |
| 1043 | char spec = form[l - 1]; |
| 1044 | strcpy(form + l - 1, lenmod); |
| 1045 | form[l + lm - 1] = spec; |
| 1046 | form[l + lm] = '\0'; |
| 1047 | } |
| 1048 | |
| 1049 | static int str_format(lua_State *L) { |
| 1050 | int top = lua_gettop(L); |