mirror of https://github.com/torvalds/linux.git
20 lines
448 B
C
20 lines
448 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
#ifndef _UTIL_H
|
|
#define _UTIL_H
|
|
|
|
#include <objtool/warn.h>
|
|
|
|
#define snprintf_check(str, size, format, args...) \
|
|
({ \
|
|
int __ret = snprintf(str, size, format, args); \
|
|
if (__ret < 0) \
|
|
ERROR_GLIBC("snprintf"); \
|
|
else if (__ret >= size) \
|
|
ERROR("snprintf() failed for '" format "'", args); \
|
|
else \
|
|
__ret = 0; \
|
|
__ret; \
|
|
})
|
|
|
|
#endif /* _UTIL_H */
|