Remove NO_VSNPRINTF
Affects only ancient VMS where vsnprintf wasn't available.
This commit is contained in:
@@ -656,11 +656,7 @@ panic VA_DECL(const char *, str)
|
||||
{
|
||||
char buf[BUFSZ];
|
||||
|
||||
#if !defined(NO_VSNPRINTF)
|
||||
(void) vsnprintf(buf, sizeof buf, str, VA_ARGS);
|
||||
#else
|
||||
Vsprintf(buf, str, VA_ARGS);
|
||||
#endif
|
||||
raw_print(buf);
|
||||
paniclog("panic", buf);
|
||||
}
|
||||
|
||||
@@ -1337,11 +1337,7 @@ nh_snprintf(
|
||||
int n;
|
||||
|
||||
va_start(ap, fmt);
|
||||
#ifdef NO_VSNPRINTF
|
||||
n = vsprintf(str, fmt, ap);
|
||||
#else
|
||||
n = vsnprintf(str, size, fmt, ap);
|
||||
#endif
|
||||
va_end(ap);
|
||||
if (n < 0 || (size_t) n >= size) { /* is there a problem? */
|
||||
impossible("snprintf %s: func %s, file line %d",
|
||||
|
||||
@@ -283,11 +283,7 @@ nh_snprintf(const char *func UNUSED, int line UNUSED, char *str, size_t size,
|
||||
int n;
|
||||
|
||||
va_start(ap, fmt);
|
||||
#ifdef NO_VSNPRINTF
|
||||
n = vsprintf(str, fmt, ap);
|
||||
#else
|
||||
n = vsnprintf(str, size, fmt, ap);
|
||||
#endif
|
||||
va_end(ap);
|
||||
|
||||
if (n < 0 || (size_t)n >= size) { /* is there a problem? */
|
||||
|
||||
20
src/pline.c
20
src/pline.c
@@ -99,9 +99,7 @@ vpline(const char *line, va_list the_args)
|
||||
char pbuf[BIGBUFSZ]; /* will get chopped down to BUFSZ-1 if longer */
|
||||
int ln;
|
||||
int msgtyp;
|
||||
#if !defined(NO_VSNPRINTF)
|
||||
int vlen = 0;
|
||||
#endif
|
||||
boolean no_repeat;
|
||||
|
||||
if (!line || !*line)
|
||||
@@ -114,7 +112,6 @@ vpline(const char *line, va_list the_args)
|
||||
return;
|
||||
|
||||
if (strchr(line, '%')) {
|
||||
#if !defined(NO_VSNPRINTF)
|
||||
vlen = vsnprintf(pbuf, sizeof(pbuf), line, the_args);
|
||||
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED) && defined(DEBUG)
|
||||
if (vlen >= (int) sizeof pbuf)
|
||||
@@ -122,9 +119,6 @@ vpline(const char *line, va_list the_args)
|
||||
"pline", sizeof pbuf, vlen);
|
||||
#else
|
||||
nhUse(vlen);
|
||||
#endif
|
||||
#else
|
||||
Vsprintf(pbuf, line, the_args);
|
||||
#endif
|
||||
line = pbuf;
|
||||
}
|
||||
@@ -476,11 +470,7 @@ vraw_printf(const char *line, va_list the_args)
|
||||
char pbuf[BIGBUFSZ]; /* will be chopped down to BUFSZ-1 if longer */
|
||||
|
||||
if (strchr(line, '%')) {
|
||||
#if !defined(NO_VSNPRINTF)
|
||||
(void) vsnprintf(pbuf, sizeof(pbuf), line, the_args);
|
||||
#else
|
||||
Vsprintf(pbuf, line, the_args);
|
||||
#endif
|
||||
line = pbuf;
|
||||
}
|
||||
if ((int) strlen(line) > BUFSZ - 1) {
|
||||
@@ -508,11 +498,7 @@ impossible(const char *s, ...)
|
||||
panic("impossible called impossible");
|
||||
|
||||
gp.program_state.in_impossible = 1;
|
||||
#if !defined(NO_VSNPRINTF)
|
||||
(void) vsnprintf(pbuf, sizeof(pbuf), s, the_args);
|
||||
#else
|
||||
Vsprintf(pbuf, s, the_args);
|
||||
#endif
|
||||
va_end(the_args);
|
||||
pbuf[BUFSZ - 1] = '\0'; /* sanity */
|
||||
paniclog("impossible", pbuf);
|
||||
@@ -609,12 +595,9 @@ config_error_add(const char *str, ...)
|
||||
static void
|
||||
vconfig_error_add(const char *str, va_list the_args)
|
||||
{ /* start of vconf...() or of nested block in USE_OLDARG's conf...() */
|
||||
#if !defined(NO_VSNPRINTF)
|
||||
int vlen = 0;
|
||||
#endif
|
||||
char buf[BIGBUFSZ]; /* will be chopped down to BUFSZ-1 if longer */
|
||||
|
||||
#if !defined(NO_VSNPRINTF)
|
||||
vlen = vsnprintf(buf, sizeof buf, str, the_args);
|
||||
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED) && defined(DEBUG)
|
||||
if (vlen >= (int) sizeof buf)
|
||||
@@ -622,9 +605,6 @@ vconfig_error_add(const char *str, va_list the_args)
|
||||
"config_error_add", sizeof buf, vlen);
|
||||
#else
|
||||
nhUse(vlen);
|
||||
#endif
|
||||
#else
|
||||
Vsprintf(buf, str, the_args);
|
||||
#endif
|
||||
buf[BUFSZ - 1] = '\0';
|
||||
config_erradd(buf);
|
||||
|
||||
Reference in New Issue
Block a user