Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions datapath/datapath.c
Original file line number Diff line number Diff line change
Expand Up @@ -2065,13 +2065,13 @@ static void set_desc(void)
return;

if (vendor)
strlcpy(mfr_desc, vendor, sizeof(mfr_desc));
strlcpy1(mfr_desc, vendor, sizeof(mfr_desc));
if (name || version)
snprintf(hw_desc, sizeof(hw_desc), "%s %s",
name ? name : "",
version ? version : "");
if (serial)
strlcpy(serial_num, serial, sizeof(serial_num));
strlcpy1(serial_num, serial, sizeof(serial_num));
}

static int __init dp_init(void)
Expand Down
2 changes: 1 addition & 1 deletion lib/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ xasprintf(const char *format, ...)
}

void
strlcpy(char *dst, const char *src, size_t size)
strlcpy1(char *dst, const char *src, size_t size)
{
if (size > 0) {
size_t n = strlen(src);
Expand Down
4 changes: 2 additions & 2 deletions lib/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ char *xasprintf(const char *format, ...) PRINTF_FORMAT(1, 2) MALLOC_LIKE;
char *xvasprintf(const char *format, va_list) PRINTF_FORMAT(1, 0) MALLOC_LIKE;
void *x2nrealloc(void *p, size_t *n, size_t s);

#ifndef HAVE_STRLCPY
void strlcpy(char *dst, const char *src, size_t size);
#ifndef HAVE_strlcpy1
void strlcpy1(char *dst, const char *src, size_t size);
#endif

void ofp_fatal(int err_no, const char *format, ...)
Expand Down
2 changes: 1 addition & 1 deletion lib/vlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ fetch_braces(const char *p, const char *def, char *out, size_t out_size)
out[n_copy] = '\0';
p += n + 2;
} else {
strlcpy(out, def, out_size);
strlcpy1(out, def, out_size);
}
return p;
}
Expand Down
2 changes: 1 addition & 1 deletion m4/libopenflow.m4
Original file line number Diff line number Diff line change
Expand Up @@ -164,5 +164,5 @@ AC_DEFUN([OFP_CHECK_LIBOPENFLOW],
AC_REQUIRE([OFP_CHECK_RUNDIR])
AC_REQUIRE([OFP_CHECK_LOGDIR])
AC_REQUIRE([OFP_CHECK_MALLOC_HOOKS])
AC_CHECK_FUNCS([strlcpy])])
AC_CHECK_FUNCS([strlcpy1])])

Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ char * epan_strcasestr(const char *haystack, const char *needle);
/* g_strlcat() does not exist in GLib 1.2[.x] */
#if GLIB_MAJOR_VERSION < 2
gsize g_strlcat(gchar *dst, const gchar *src, gsize size);
gsize g_strlcpy(gchar *dest, const gchar *src, gsize dest_size);
gsize g_strlcpy1(gchar *dest, const gchar *src, gsize dest_size);
#endif

#if GLIB_MAJOR_VERSION < 2
Expand Down