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:
Alejandro Colomar
2023-09-02 14:21:49 +02:00
committed by Iker Pedrosa
parent 6879f46327
commit 0f27931155
2 changed files with 7 additions and 3 deletions
+4 -1
View File
@@ -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
View File
@@ -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;