** add length modifier into formats */
| 1261 | ** add length modifier into formats |
| 1262 | */ |
| 1263 | static void addlenmod (char *form, const char *lenmod) { |
| 1264 | size_t l = strlen(form); |
| 1265 | size_t lm = strlen(lenmod); |
| 1266 | char spec = form[l - 1]; |
| 1267 | strcpy(form + l - 1, lenmod); |
| 1268 | form[l + lm - 1] = spec; |
| 1269 | form[l + lm] = '\0'; |
| 1270 | } |
| 1271 | |
| 1272 | |
| 1273 | static int str_format (lua_State *L) { |