summaryrefslogtreecommitdiff
path: root/textproc/c2html/patches/patch-aa
blob: acd1295432a471eee380f0cdd6de0e65e140817a (plain)
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
$NetBSD: patch-aa,v 1.1.1.1 2007/01/29 16:40:58 minskim Exp $

Some platforms (GNU) lack strl* functions.
Anyways, here the return value is not checked, so toe only
difference is the trailing \0-padding, which has just very
minor performance implications.

--- build_ht.c.orig	2007-01-26 18:23:32.000000000 +0100
+++ build_ht.c
@@ -101,7 +101,7 @@ char **build_ht(char **strings, int nr_o
 	prevline[0] = '\0';
 
 	while (cur_string_no < nr_of_strings) {
-		strlcpy(line, strings[cur_string_no], sizeof line);
+		strncpy(line, strings[cur_string_no], sizeof line);
 
 		if (isdigit(line[0]) && strcmp(line, prevline) != 0) {
 			/*  Get the hashcode from the line:  */
@@ -148,7 +148,7 @@ char **build_ht(char **strings, int nr_o
 			cp += strlen(line+i);
 		}
 
-		strlcpy(prevline, line, sizeof(prevline));
+		strncpy(prevline, line, sizeof(prevline));
 		cur_string_no ++;
 	}