winspool.drv: Const-correctness fix.

This commit is contained in:
Andrew Talbot 2011-09-12 23:18:01 +01:00 committed by Alexandre Julliard
parent 96567b18b0
commit 4c7f394b74
1 changed files with 13 additions and 8 deletions

View File

@ -516,6 +516,8 @@ static BOOL CUPS_LoadPrinters(void)
static BOOL static BOOL
PRINTCAP_ParseEntry(const char *pent, BOOL isfirst) { PRINTCAP_ParseEntry(const char *pent, BOOL isfirst) {
PRINTER_INFO_2A pinfo2a; PRINTER_INFO_2A pinfo2a;
const char *r;
size_t name_len;
char *e,*s,*name,*prettyname,*devname; char *e,*s,*name,*prettyname,*devname;
BOOL ret = FALSE, set_default = FALSE; BOOL ret = FALSE, set_default = FALSE;
char *port = NULL, *env_default; char *port = NULL, *env_default;
@ -523,14 +525,17 @@ PRINTCAP_ParseEntry(const char *pent, BOOL isfirst) {
WCHAR devnameW[MAX_PATH]; WCHAR devnameW[MAX_PATH];
while (isspace(*pent)) pent++; while (isspace(*pent)) pent++;
s = strchr(pent,':'); r = strchr(pent,':');
if(s) *s='\0'; if (r)
name = HeapAlloc(GetProcessHeap(), 0, strlen(pent) + 1); name_len = r - pent;
strcpy(name,pent); else
if(s) { name_len = strlen(pent);
*s=':'; name = HeapAlloc(GetProcessHeap(), 0, name_len + 1);
pent = s; memcpy(name, pent, name_len);
} else name[name_len] = '\0';
if (r)
pent = r;
else
pent = ""; pent = "";
TRACE("name=%s entry=%s\n",name, pent); TRACE("name=%s entry=%s\n",name, pent);