diff options
author | Bruno Haible <bruno@clisp.org> | 2006-05-03 12:13:13 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-23 12:13:13 +0200 |
commit | 019d270c02816ce99e75545dab55c53291a670b3 (patch) | |
tree | 23358e1c4d11e3f12acfc80394f0320f75fcb61a /gettext-tools/src/write-java.c | |
parent | 25d7990e12e56643490f4c2133c8d4922cf95665 (diff) | |
download | external_gettext-019d270c02816ce99e75545dab55c53291a670b3.zip external_gettext-019d270c02816ce99e75545dab55c53291a670b3.tar.gz external_gettext-019d270c02816ce99e75545dab55c53291a670b3.tar.bz2 |
Code simplification: use xasprintf.
Diffstat (limited to 'gettext-tools/src/write-java.c')
-rw-r--r-- | gettext-tools/src/write-java.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/gettext-tools/src/write-java.c b/gettext-tools/src/write-java.c index 29ad650..b4d8f3f 100644 --- a/gettext-tools/src/write-java.c +++ b/gettext-tools/src/write-java.c @@ -66,6 +66,7 @@ #include "c-ctype.h" #include "error.h" #include "xerror.h" +#include "xvasprintf.h" #include "javacomp.h" #include "message.h" #include "msgfmt.h" @@ -948,11 +949,7 @@ but the Java ResourceBundle format doesn't support contexts\n"))); } if (locale_name != NULL) - { - class_name = - (char *) xmalloc (strlen (resource_name) + 1 + strlen (locale_name) + 1); - sprintf (class_name, "%s_%s", resource_name, locale_name); - } + class_name = xasprintf ("%s_%s", resource_name, locale_name); else class_name = xstrdup (resource_name); @@ -979,8 +976,7 @@ but the Java ResourceBundle format doesn't support contexts\n"))); if (locale_name != NULL) { - char *suffix = (char *) xmalloc (1 + strlen (locale_name) + 5 + 1); - sprintf (suffix, "_%s.java", locale_name); + char *suffix = xasprintf ("_%s.java", locale_name); java_file_name = concatenated_pathname (last_dir, p, suffix); free (suffix); } |