When "%*s" is specified, the first integer is interpreted as width.
Width specifies *minimum* number of characters to output. The next
string is expected to be NULL-terminated.
When "%.*s" is specified, the first integer is interpreted as precision.
Precision specifies *maximum* number of characters to output.
(void) close(info.fd);
if (njs_slow_path(ret != NJS_OK)) {
- JS_ThrowInternalError(ctx, "while reading \"%*s\" module",
+ JS_ThrowInternalError(ctx, "while reading \"%.*s\" module",
(int) info.file.length, info.file.start);
return NULL;
}
ret = njs_console_set_cwd(console, &info.file);
if (njs_slow_path(ret != NJS_OK)) {
- JS_ThrowInternalError(ctx, "while setting cwd for \"%*s\" module",
+ JS_ThrowInternalError(ctx, "while setting cwd for \"%.*s\" module",
(int) info.file.length, info.file.start);
return NULL;
}
return -1;
}
- JS_ThrowTypeError(ctx, "unhandled promise rejection: %*s", (int) len, str);
+ JS_ThrowTypeError(ctx, "unhandled promise rejection: %.*s", (int) len, str);
JS_FreeCString(ctx, str);
for (i = 0; i < console->rejected_promises->items; i++) {
}
}
- JS_ThrowTypeError(cx, "%*s", (int) (p - errstr), errstr);
+ JS_ThrowTypeError(cx, "%.*s", (int) (p - errstr), errstr);
}
(void) close(info.fd);
if (ret != NJS_OK) {
- JS_ThrowInternalError(cx, "while reading \"%*s\" module",
+ JS_ThrowInternalError(cx, "while reading \"%.*s\" module",
(int) info.file.length, info.file.start);
return NULL;
}
return -1;
}
- JS_ThrowTypeError(cx, "unhandled promise rejection: %*s", (int) len, str);
+ JS_ThrowTypeError(cx, "unhandled promise rejection: %.*s", (int) len, str);
JS_FreeCString(cx, str);
for (i = 0; i < ctx->rejected_promises->items; i++) {
}
if (i == n) {
- (void) JS_ThrowInternalError(cx, "unknown event \"%*s\"",
+ (void) JS_ThrowInternalError(cx, "unknown event \"%.*s\"",
(int) event->len, event->data);
return NULL;
}
JS_FreeCString(ctx, (char *) name.start);
if (thrw) {
- JS_ThrowTypeError(ctx, "\"%*s\" encoding is not supported",
+ JS_ThrowTypeError(ctx, "\"%.*s\" encoding is not supported",
(int) name.length, name.start);
}