From 654da2ffb5abf2afe9532f1d0cb77ed88f8a97cc Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Tue, 28 Jan 2014 21:40:13 +0000 Subject: move utf8 conversion routines to use nserror instead of their own error enum --- monkey/utils.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'monkey') diff --git a/monkey/utils.c b/monkey/utils.c index 88776a90f..742c300f1 100644 --- a/monkey/utils.c +++ b/monkey/utils.c @@ -38,20 +38,16 @@ void die(const char * const error) exit(EXIT_FAILURE); } -utf8_convert_ret -utf8_to_local_encoding(const char *string, size_t len, - char **result) +nserror utf8_to_local_encoding(const char *string, size_t len, char **result) { *result = strndup(string, len); - return (*result == NULL) ? UTF8_CONVERT_NOMEM : UTF8_CONVERT_OK; + return (*result == NULL) ? NSERROR_NOMEM : NSERROR_OK; } -utf8_convert_ret -utf8_from_local_encoding(const char *string, size_t len, - char **result) +nserror utf8_from_local_encoding(const char *string, size_t len, char **result) { *result = strndup(string, len); - return (*result == NULL) ? UTF8_CONVERT_NOMEM : UTF8_CONVERT_OK; + return (*result == NULL) ? NSERROR_NOMEM : NSERROR_OK; } -- cgit v1.2.3