summaryrefslogtreecommitdiff
path: root/source3/printing/pcap.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-11-21 13:56:36 -0800
committerJeremy Allison <jra@samba.org>2007-11-21 13:56:36 -0800
commit01acd4bb3833733f7487ad86ea6542239fe3c90b (patch)
tree0cfdc8bbb05ca65cf0f7761ed636244a7a76d714 /source3/printing/pcap.c
parentdc9237d231a39bbed988baa9371ceb785ba32665 (diff)
downloadsamba-01acd4bb3833733f7487ad86ea6542239fe3c90b.tar.gz
samba-01acd4bb3833733f7487ad86ea6542239fe3c90b.tar.bz2
samba-01acd4bb3833733f7487ad86ea6542239fe3c90b.zip
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)
Diffstat (limited to 'source3/printing/pcap.c')
-rw-r--r--source3/printing/pcap.c17
1 files changed, 9 insertions, 8 deletions
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;
}
}