1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
$NetBSD: patch-bj,v 1.4 2008/07/14 23:01:32 christos Exp $
--- clients/uil/UilDiags.c.orig 2006-04-06 09:24:06.000000000 -0400
+++ clients/uil/UilDiags.c 2008-06-28 16:17:21.000000000 -0400
@@ -317,13 +317,13 @@
*/
#ifndef NO_MESSAGE_CATALOG
- sprintf( loc_buffer,
+ snprintf( loc_buffer, sizeof(loc_buffer),
catgets(uil_catd, UIL_SET_MISC,
UIL_MISC_0, "\t\t line: %d file: %s"),
az_src_rec->w_line_number,
src_get_file_name( az_src_rec ) );
#else
- sprintf( loc_buffer,
+ snprintf( loc_buffer, sizeof(loc_buffer),
"\t\t line: %d file: %s",
az_src_rec->w_line_number,
src_get_file_name( az_src_rec ) );
@@ -371,7 +371,7 @@
if (l_start_column != diag_k_no_column)
#ifndef NO_MESSAGE_CATALOG
- sprintf(loc_buffer,
+ snprintf(loc_buffer, sizeof(loc_buffer),
catgets(uil_catd, UIL_SET_MISC,
UIL_MISC_1,
"\t\t line: %d position: %d file: %s"),
@@ -379,7 +379,7 @@
l_start_column + 1,
src_get_file_name( az_src_rec ) );
#else
- sprintf(loc_buffer,
+ snprintf(loc_buffer, sizeof(loc_buffer),
"\t\t line: %d position: %d file: %s",
az_src_rec->w_line_number,
l_start_column + 1,
@@ -387,13 +387,14 @@
#endif
else
#ifndef NO_MESSAGE_CATALOG
- sprintf( loc_buffer, catgets(uil_catd, UIL_SET_MISC,
+ snprintf( loc_buffer, sizeof(loc_buffer),
+ catgets(uil_catd, UIL_SET_MISC,
UIL_MISC_0,
"\t\t line: %d file: %s"),
az_src_rec->w_line_number,
src_get_file_name( az_src_rec ) );
#else
- sprintf( loc_buffer,
+ snprintf( loc_buffer, sizeof(loc_buffer),
"\t\t line: %d file: %s",
az_src_rec->w_line_number,
src_get_file_name( az_src_rec ) );
|