Fix off by one error in WINSPOOL_GetOpenedPrinterA.

This commit is contained in:
Huw D M Davies 1999-09-03 12:20:57 +00:00 committed by Alexandre Julliard
parent 1c40562bc1
commit 44d6fec90e
1 changed files with 2 additions and 1 deletions

View File

@ -103,11 +103,12 @@ static LPOPENEDPRINTERA WINSPOOL_GetOpenedPrinterA(int printerHandle)
{ {
LPOPENEDPRINTERA pOpenedPrinter; LPOPENEDPRINTERA pOpenedPrinter;
if(!pOpenedPrinterDPA) return NULL;
if((printerHandle <=0) || if((printerHandle <=0) ||
(printerHandle > (pOpenedPrinterDPA->nItemCount - 1))) (printerHandle > (pOpenedPrinterDPA->nItemCount - 1)))
return NULL; return NULL;
pOpenedPrinter = WINSPOOL_DPA_GetPtr(pOpenedPrinterDPA, printerHandle); pOpenedPrinter = WINSPOOL_DPA_GetPtr(pOpenedPrinterDPA, printerHandle-1);
return pOpenedPrinter; return pOpenedPrinter;
} }