Wireshark mailing list archives

Re: UTF8 vs. locale in error messages (bug 5715)


From: Jakub Zawadzki <darkjames-ws () darkjames pl>
Date: Tue, 28 Jun 2011 09:35:47 +0200

On Mon, Jun 27, 2011 at 05:58:35PM -0700, Guy Harris wrote:
We have about 240 calls to strerror().

...and, unfortunately, a variant that converts to UTF-8 and is API-compatible is non-trivial, 
as any version that allocates a buffer for the result of the conversion would leak memory 
we just globally replaced strerror() with ws_strerror().

g_strerror() [1]?

Returns :
  a UTF-8 string describing the error code. If the error code is
  unknown, it returns "unknown error (<code>)". 
  The string can only be used until the next call to g_strerror()

[1] http://developer.gnome.org/glib/2.28/glib-String-Utility-Functions.html#g-strerror
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe


Current thread: