diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2017-10-29 19:22:39 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2017-10-29 21:10:23 +0000 |
commit | 62b870a72261f71f66ece9cb3b892d9999e805e3 (patch) | |
tree | eadf2a0cb1769fb547147b9ec04454e07a2ec91d /wsutil/inet_addr.h | |
parent | bebd79aae9ccaf5c96666d38665b69484f1f3eda (diff) |
Do not assert in ws_inet_ntop()
Change-Id: I9d420c5f6bc29ce94855017739169dc8e8ce4d48
Reviewed-on: https://code.wireshark.org/review/24173
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'wsutil/inet_addr.h')
-rw-r--r-- | wsutil/inet_addr.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/wsutil/inet_addr.h b/wsutil/inet_addr.h index 05670e8ae5..a3d45e25db 100644 --- a/wsutil/inet_addr.h +++ b/wsutil/inet_addr.h @@ -73,21 +73,19 @@ #endif /* - * 'dst_size' *must* be greater or equal to WS_INET_ADDRSTRLEN. + * To check for errors set errno to zero before calling ws_inet_ntop{4,6}. + * ENOSPC is set if the result exceeds the given buffer size. */ WS_DLL_PUBLIC WS_RETNONNULL const gchar * ws_inet_ntop4(gconstpointer src, gchar *dst, guint dst_size); -WS_DLL_PUBLIC gboolean -ws_inet_pton4(const gchar *src, guint32 *dst); - -/* - * 'dst_size' *must* be greater or equal to WS_INET6_ADDRSTRLEN. - */ WS_DLL_PUBLIC WS_RETNONNULL const gchar * ws_inet_ntop6(gconstpointer src, gchar *dst, guint dst_size); WS_DLL_PUBLIC gboolean +ws_inet_pton4(const gchar *src, guint32 *dst); + +WS_DLL_PUBLIC gboolean ws_inet_pton6(const gchar *src, ws_in6_addr *dst); #endif |