Added MAXPRINTERLEN define in smb.h setting printer share name length to maximumof...
authorJohn Terpstra <jht@samba.org>
Fri, 20 Mar 1998 13:37:46 +0000 (13:37 +0000)
committerJohn Terpstra <jht@samba.org>
Fri, 20 Mar 1998 13:37:46 +0000 (13:37 +0000)
it in smb.h.
(This used to be commit 3dfe0b135dd91864a81a5fadddc9151ac8812c6e)

source3/include/smb.h
source3/printing/pcap.c

index 0acc5cbfa340f79981fe8a7a8f80de20ec278186..f0cdf9f356f64591347f2ea89cb358419d0cf888 100644 (file)
@@ -24,6 +24,9 @@
 #ifndef _SMB_H
 #define _SMB_H
 
+/* Yves Gaige <yvesg@hptnodur.grenoble.hp.com> requested this */
+#define MAXPRINTERLEN 15
+
 #define BUFFER_SIZE (0xFFFF)
 #define SAFETY_MARGIN 1024
 
index 3698114a2f5153ed3b71898dc1e867112487692e..38c4dec3fcaab3661fe0150c2107578e6ba24941 100644 (file)
@@ -375,7 +375,7 @@ void pcap_printer_fn(void (*fn)())
              continue;
            }
 
-         if (strlen(p) <= 8 && strlen(p)>strlen(name) && !has_punctuation)
+         if (strlen(p) <= MAXPRINTERLEN && strlen(p)>strlen(name) && !has_punctuation)
            {
              if (!*comment) pstrcpy(comment,name);
              pstrcpy(name,p);
@@ -391,7 +391,7 @@ void pcap_printer_fn(void (*fn)())
        }
 
       comment[60] = 0;
-      name[8] = 0;
+      name[MAXPRINTERLEN] = 0;
 
       if (*name)
        fn(name,comment);