X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=libaltos%2Flibaltos.c;h=b7ec98fc58f5c17994c523955b4e20c6d680f23d;hp=a623d5ae0b5c187f9b0c5a7bec962b1c73e2451d;hb=9e18c524fa2d1f648f265b3c3105f5ceacf06c10;hpb=7b275ddfe20f54857d7d1abb98607c406b678090 diff --git a/libaltos/libaltos.c b/libaltos/libaltos.c index a623d5ae..b7ec98fc 100644 --- a/libaltos/libaltos.c +++ b/libaltos/libaltos.c @@ -817,7 +817,7 @@ get_string(io_object_t object, CFStringRef entry, char *result, int result_len) got_string = CFStringGetCString(entry_as_string, result, result_len, kCFStringEncodingASCII); - + CFRelease(entry_as_string); if (got_string) return 1; @@ -830,7 +830,7 @@ get_number(io_object_t object, CFStringRef entry, int *result) { CFTypeRef entry_as_number; Boolean got_number; - + entry_as_number = IORegistryEntrySearchCFProperty (object, kIOServicePlane, entry, @@ -885,7 +885,7 @@ altos_list_next(struct altos_list *list, struct altos_device *device) object = IOIteratorNext(list->iterator); if (!object) return 0; - + if (!get_number (object, CFSTR(kUSBVendorID), &device->vendor) || !get_number (object, CFSTR(kUSBProductID), &device->product)) continue; @@ -989,7 +989,7 @@ log_message(char *fmt, ...) if (log) { SYSTEMTIME time; GetLocalTime(&time); - fprintf (log, "%4d-%02d-%02d %2d:%02d:%02d. ", + fprintf (log, "%4d-%02d-%02d %2d:%02d:%02d. ", time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond); va_start(a, fmt); @@ -1340,7 +1340,7 @@ altos_open(struct altos_device *device) altos_set_last_windows_error(); Sleep(100); } - + if (file->handle == INVALID_HANDLE_VALUE) { free(file); return NULL;