os: drop unused Xscnprintf() and Xvscnprintf()

Not used anywhere (not even in drivers), so no need to keep them anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-11-06 15:31:47 +01:00
committed by Enrico Weigelt
parent 0c7799b916
commit b3a5b5b61c
2 changed files with 0 additions and 56 deletions

View File

@@ -55,16 +55,4 @@ extern _X_EXPORT int
XNFvasprintf(char **ret, const char *_X_RESTRICT_KYWD fmt, va_list va)
_X_ATTRIBUTE_PRINTF(2, 0);
/*
* These functions provide a portable implementation of the linux kernel
* scnprintf & vscnprintf routines that return the number of bytes actually
* copied during a snprintf, (excluding the final '\0').
*/
extern _X_EXPORT int
Xscnprintf(char *s, int n, const char * _X_RESTRICT_KYWD fmt, ...)
_X_ATTRIBUTE_PRINTF(3,4);
extern _X_EXPORT int
Xvscnprintf(char *s, int n, const char * _X_RESTRICT_KYWD fmt, va_list va)
_X_ATTRIBUTE_PRINTF(3,0);
#endif /* XPRINTF_H */

View File

@@ -111,47 +111,3 @@ XNFasprintf(char **ret, const char *_X_RESTRICT_KYWD format, ...)
va_end(va);
return size;
}
/**
* Varargs snprintf that returns the actual number of bytes (excluding final
* '\0') that were copied into the buffer.
* This is opposed to the normal sprintf() usually returns the number of bytes
* that would have been written.
*
* @param s buffer to copy into
* @param n size of buffer s
* @param format printf style format string
* @param va variable argument list
* @return number of bytes actually copied, excluding final '\0'
*/
int
Xvscnprintf(char *s, int n, const char *format, va_list args)
{
int x;
if (n == 0)
return 0;
x = vsnprintf(s, n , format, args);
return (x >= n) ? (n - 1) : x;
}
/**
* snprintf that returns the actual number of bytes (excluding final '\0') that
* were copied into the buffer.
* This is opposed to the normal sprintf() usually returns the number of bytes
* that would have been written.
*
* @param s buffer to copy into
* @param n size of buffer s
* @param format printf style format string
* @param ... arguments for specified format
* @return number of bytes actually copied, excluding final '\0'
*/
int Xscnprintf(char *s, int n, const char *format, ...)
{
int x;
va_list ap;
va_start(ap, format);
x = Xvscnprintf(s, n, format, ap);
va_end(ap);
return x;
}