From 01acd4bb3833733f7487ad86ea6542239fe3c90b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 21 Nov 2007 13:56:36 -0800 Subject: Remove pstring from printing/*.c except for the tdb_unpack requirement (I'll be making that an allocating interface later). Jeremy. (This used to be commit d2ee75326ac291ab4f1860075ba35f58703c7d9d) --- source3/printing/pcap.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'source3/printing/pcap.c') diff --git a/source3/printing/pcap.c b/source3/printing/pcap.c index aabdb73e2e..30cb254a29 100644 --- a/source3/printing/pcap.c +++ b/source3/printing/pcap.c @@ -159,8 +159,9 @@ void pcap_cache_reload(void) goto done; } - for (; (pcap_line = fgets_slash(NULL, sizeof(pstring), pcap_file)) != NULL; safe_free(pcap_line)) { - pstring name, comment; + for (; (pcap_line = fgets_slash(NULL, 1024, pcap_file)) != NULL; safe_free(pcap_line)) { + char name[MAXPRINTERLEN+1]; + char comment[62]; char *p, *q; if (*pcap_line == '#' || *pcap_line == 0) @@ -186,22 +187,22 @@ void pcap_cache_reload(void) strchr_m(p, ')')); if (strlen(p) > strlen(comment) && has_punctuation) { - pstrcpy(comment, p); + strlcpy(comment, p, sizeof(comment)); continue; } if (strlen(p) <= MAXPRINTERLEN && strlen(p) > strlen(name) && !has_punctuation) { - if (!*comment) - pstrcpy(comment, name); - - pstrcpy(name, p); + if (!*comment) { + strlcpy(comment, name, sizeof(comment)); + } + strlcpy(name, p, sizeof(name)); continue; } if (!strchr_m(comment, ' ') && strlen(p) > strlen(comment)) { - pstrcpy(comment, p); + strlcpy(comment, p, sizeof(comment)); continue; } } -- cgit