GCC 8.1 warns:
rte_string_fns.h: In function 'rte_strlcpy':
rte_string_fns.h:58:9:
warning: conversion to 'size_t' {aka 'long unsigned int'} from
'int' may change the sign of the result [-Wsign-conversion]
return snprintf(dst, size, "%s", src);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes:
5364de644a4b ("eal: support strlcpy function")
Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
static inline size_t
rte_strlcpy(char *dst, const char *src, size_t size)
{
- return snprintf(dst, size, "%s", src);
+ return (size_t)snprintf(dst, size, "%s", src);
}
/* pull in a strlcpy function */