diff options
author | behdad <behdad> | 2002-01-22 21:33:07 +0000 |
---|---|---|
committer | behdad <behdad> | 2002-01-22 21:33:07 +0000 |
commit | d813d98cafba1d4bd25ba34fbbc924d0cc0bc803 (patch) | |
tree | ba511dd9c0ed69a4aaf9a48415f4c5bcdb536f65 | |
parent | 0a39c5c02c0d512c46dd4e2cf77bde748aced57c (diff) |
Use sprintf instead of snprintf.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | fribidi_create_char_types.c | 9 | ||||
-rw-r--r-- | fribidi_create_mirroring.c | 9 |
3 files changed, 15 insertions, 7 deletions
@@ -1,3 +1,7 @@ +2002-01-23 Behdad Esfahbod <behdad@bamdad.org> + * fribidi_create_char_types.c, fribidi_create_mirroring.c: Changed + to use sprintf() instead of snprintf(). + 2002-01-04 Roozbeh Pournader <roozbeh@sharif.edu> * FriBidi 0.10.1 released. * configure.in: Changed the version to 0.10.1. diff --git a/fribidi_create_char_types.c b/fribidi_create_char_types.c index 794fe6d..34c62f0 100644 --- a/fribidi_create_char_types.c +++ b/fribidi_create_char_types.c @@ -86,7 +86,7 @@ type_names[] = static char *names[type_names_count]; -static char unidata_file[200]; +static char *unidata_file; static char get_type (char *s) @@ -229,11 +229,12 @@ int main (int argc, char **argv) { int max_depth; - char file[50]; + char file[50], *p; if (argc < 2) err ("usage: fribidi_create_char_types max_depth [UnicodeData.txt path]"); - snprintf (unidata_file, sizeof unidata_file, - "%s/UnicodeData.txt", (argc >= 3) ? argv[2] : "unidata"); + p = (argc >= 3) ? argv[2] : "unidata"; + unidata_file = malloc (50 + strlen (p)); + sprintf (unidata_file, "%s/UnicodeData.txt", p); max_depth = atoi (argv[1]); if (!max_depth) err ("invalid depth"); diff --git a/fribidi_create_mirroring.c b/fribidi_create_mirroring.c index cd75f7c..435df29 100644 --- a/fribidi_create_mirroring.c +++ b/fribidi_create_mirroring.c @@ -34,7 +34,7 @@ err2 (char *fmt, char *p) static int table[0x110000]; static char *bidi_mirroring_version; -static char bidi_mirroring_file[200]; +static char *bidi_mirroring_file; static int mirroring_count; @@ -127,8 +127,11 @@ write_mirror (char *file) int main (int argc, char **argv) { - snprintf (bidi_mirroring_file, sizeof bidi_mirroring_file, - "%s/BidiMirroring.txt", (argc >= 2) ? argv[1] : "unidata"); + char *p; + + p = (argc >= 2) ? argv[1] : "unidata"; + bidi_mirroring_file = malloc (50 + strlen (p)); + sprintf (bidi_mirroring_file, "%s/BidiMirroring.txt", p); read_bidi_mirroring (); write_mirror ("fribidi_tab_mirroring.i"); return 0; |