** add length modifier into formats */
| 1004 | ** add length modifier into formats |
| 1005 | */ |
| 1006 | static void addlenmod (char *form, const char *lenmod) { |
| 1007 | size_t l = strlen(form); |
| 1008 | size_t lm = strlen(lenmod); |
| 1009 | char spec = form[l - 1]; |
| 1010 | strcpy(form + l - 1, lenmod); |
| 1011 | form[l + lm - 1] = spec; |
| 1012 | form[l + lm] = '\0'; |
| 1013 | } |
| 1014 | |
| 1015 | |
| 1016 | static int str_format (lua_State *L) { |