mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
util: use g_vsnprintf
Instead of vsnprintf from gnulib, use g_vsnprintf from GLib. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
5ff6eb5dc7
commit
ec07893a5f
@ -445,6 +445,12 @@ sc_prohibit_asprintf:
|
|||||||
halt='use g_strdup instead of g_strdup_printf with "%s"' \
|
halt='use g_strdup instead of g_strdup_printf with "%s"' \
|
||||||
$(_sc_search_regexp)
|
$(_sc_search_regexp)
|
||||||
|
|
||||||
|
sc_prohobit_vsnprintf:
|
||||||
|
@prohibit='\<vsnprintf\>' \
|
||||||
|
in_vc_files='\.[chx]$$' \
|
||||||
|
halt='use g_vsnprintf, not vsnprintf' \
|
||||||
|
$(_sc_search_regexp)
|
||||||
|
|
||||||
sc_prohibit_strdup:
|
sc_prohibit_strdup:
|
||||||
@prohibit='\<strn?dup\> *\(' \
|
@prohibit='\<strn?dup\> *\(' \
|
||||||
halt='use VIR_STRDUP, not strdup' \
|
halt='use VIR_STRDUP, not strdup' \
|
||||||
|
@ -1288,7 +1288,7 @@ void virReportErrorHelper(int domcode,
|
|||||||
|
|
||||||
if (fmt) {
|
if (fmt) {
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
vsnprintf(errorMessage, sizeof(errorMessage)-1, fmt, args);
|
g_vsnprintf(errorMessage, sizeof(errorMessage)-1, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
} else {
|
} else {
|
||||||
errorMessage[0] = '\0';
|
errorMessage[0] = '\0';
|
||||||
@ -1358,7 +1358,7 @@ void virReportSystemErrorFull(int domcode,
|
|||||||
int n;
|
int n;
|
||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
n = vsnprintf(msgDetailBuf, sizeof(msgDetailBuf), fmt, args);
|
n = g_vsnprintf(msgDetailBuf, sizeof(msgDetailBuf), fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
size_t len = strlen(errnoDetail);
|
size_t len = strlen(errnoDetail);
|
||||||
|
@ -764,7 +764,7 @@ virTypedParamSetNameVPrintf(virTypedParameterPtr par,
|
|||||||
const char *fmt,
|
const char *fmt,
|
||||||
va_list ap)
|
va_list ap)
|
||||||
{
|
{
|
||||||
if (vsnprintf(par->field, VIR_TYPED_PARAM_FIELD_LENGTH, fmt, ap) > VIR_TYPED_PARAM_FIELD_LENGTH) {
|
if (g_vsnprintf(par->field, VIR_TYPED_PARAM_FIELD_LENGTH, fmt, ap) > VIR_TYPED_PARAM_FIELD_LENGTH) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Field name too long"));
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Field name too long"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user