From: Tim W. <tw...@re...> - 2005-11-25 13:54:44
|
Hi, Here is a patch to fix the storage size of the variable provided to accept the data from the LPGETSTATUS ioctl. This control returns sizeof(int) bytes. The symptom that lead me to investigate this was that hpiod was send()ing "" -- the res variable was getting overwritten with zeros. Tim. */ --- hplip-0.9.7/io/hpiod/device.cpp.lpgetstatus 2005-11-25 12:55:05.000000000 +0000 +++ hplip-0.9.7/io/hpiod/device.cpp 2005-11-25 12:56:13.000000000 +0000 @@ -392,9 +392,9 @@ int Device::GetDeviceStatus(char *sendBuf, int *result) { - char res[] = "msg=DeviceStatusResult\nresult-code=%d\nstatus-code=%d\nstatus-name=%s\n"; + const char res[] = "msg=DeviceStatusResult\nresult-code=%d\nstatus-code=%d\nstatus-name=%s\n"; int len=0, r; - unsigned char status; + unsigned int status; char vstatus[16]; *result = R_AOK; |