X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Fi18n.c;h=29148a0e7a9789cf9cbee7c5d6ac764c83f8ff10;hb=f5099c58d17e8f66a74a84918e688ef17936d392;hp=13a46a53c46cc86a19ac80228b4ebd14c035d7e5;hpb=6d89701ab597b810da249ff0e4e42423e869df66;p=pspp-builds.git diff --git a/src/libpspp/i18n.c b/src/libpspp/i18n.c index 13a46a53..29148a0e 100644 --- a/src/libpspp/i18n.c +++ b/src/libpspp/i18n.c @@ -110,6 +110,17 @@ recode_string (const char *to, const char *from, return recode_string_pool (to, from, text, length, NULL); } +/* Returns the length, in bytes, of the string that a similar recode_string() + call would return. */ +size_t +recode_string_len (const char *to, const char *from, + const char *text, int length) +{ + char *s = recode_string (to, from, text, length); + size_t len = strlen (s); + free (s); + return len; +} /* Uses CONV to convert the INBYTES starting at IP into the OUTBYTES starting at OP, and appends a null terminator to the output.