lib/strlcpy.[ch]: Fix return type
To return an error code, we need ssize_t. Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Iker Pedrosa
parent
6879f46327
commit
0f27931155
+4
-1
@@ -6,10 +6,13 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ident "$Id$"
|
||||
|
||||
#include "strlcpy.h"
|
||||
|
||||
|
||||
extern inline size_t strlcpy_(char *restrict dst, const char *restrict src,
|
||||
extern inline ssize_t strlcpy_(char *restrict dst, const char *restrict src,
|
||||
size_t size);
|
||||
|
||||
+3
-2
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "sizeof.h"
|
||||
|
||||
@@ -45,11 +46,11 @@
|
||||
#define STRLCPY(dst, src) strlcpy_(dst, src, SIZEOF_ARRAY(dst))
|
||||
|
||||
|
||||
inline size_t strlcpy_(char *restrict dst, const char *restrict src,
|
||||
inline ssize_t strlcpy_(char *restrict dst, const char *restrict src,
|
||||
size_t size);
|
||||
|
||||
|
||||
inline size_t
|
||||
inline ssize_t
|
||||
strlcpy_(char *restrict dst, const char *restrict src, size_t size)
|
||||
{
|
||||
size_t len;
|
||||
|
||||
Reference in New Issue
Block a user