openbsd-ports/print/cups/patches/patch-systemv_lpadmin_c
ajacoutot dd310005da Major update to cups-1.5.0.
Thanks to landry@ for the bulk testing.
2011-09-08 10:33:12 +00:00

30 lines
928 B
Plaintext

$OpenBSD: patch-systemv_lpadmin_c,v 1.7 2011/09/08 10:33:12 ajacoutot Exp $
--- systemv/lpadmin.c.orig Fri May 20 05:49:49 2011
+++ systemv/lpadmin.c Fri Sep 2 09:33:11 2011
@@ -1494,14 +1494,14 @@ set_printer_options(
static int /* O - 0 if name is no good, 1 if name is good */
validate_name(const char *name) /* I - Name to check */
{
- const char *ptr; /* Pointer into name */
+ const signed char *ptr; /* Pointer into name */
/*
* Scan the whole name...
*/
- for (ptr = name; *ptr; ptr ++)
+ for (ptr = (const signed char *)name; *ptr; ptr ++)
if (*ptr == '@')
break;
else if ((*ptr >= 0 && *ptr <= ' ') || *ptr == 127 || *ptr == '/' ||
@@ -1512,7 +1512,7 @@ validate_name(const char *name) /* I - Name to check
* All the characters are good; validate the length, too...
*/
- return ((ptr - name) < 128);
+ return ((ptr - (const signed char *)name) < 128);
}