X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=windows.c;h=523b8d0ac034ba0ebbb486df1c0b6b025ae817c4;hb=d66bbceaa7f86262bc8e758e7a665fcce7340f01;hp=72a3ee3e64abaa6e89cac081f3fca455891ee521;hpb=7aeb6736bdc64fcbb4ab682fe8b2110bfa77d5cd;p=libserialport.git diff --git a/windows.c b/windows.c index 72a3ee3..523b8d0 100644 --- a/windows.c +++ b/windows.c @@ -253,7 +253,7 @@ static void enumerate_hub(struct sp_port *port, char *hub_name, /* get the number of ports of the hub */ if (DeviceIoControl(hub_device, IOCTL_USB_GET_NODE_INFORMATION, &hub_info, size, &hub_info, size, &size, NULL)) - /* enumarate the ports of the hub */ + /* enumerate the ports of the hub */ enumerate_hub_ports(port, hub_device, hub_info.u.HubInformation.HubDescriptor.bNumberOfPorts, parent_path); @@ -448,7 +448,7 @@ SP_PRIV enum sp_return get_port_details(struct sp_port *port) free(escaped_port_name); CloseHandle(handle); - /* retrive USB device details from the device descriptor */ + /* retrieve USB device details from the device descriptor */ get_usb_details(port, device_info_data.DevInst); } break; @@ -499,21 +499,21 @@ SP_PRIV enum sp_return list_ports(struct sp_port ***list) NULL, &type, (LPBYTE)data, &data_size) == ERROR_SUCCESS) { if (type == REG_SZ) { - data_len = data_size / sizeof(TCHAR); - data[data_len] = '\0'; + data_len = data_size / sizeof(TCHAR); + data[data_len] = '\0'; #ifdef UNICODE - name_len = WideCharToMultiByte(CP_ACP, 0, data, -1, NULL, 0, NULL, NULL); + name_len = WideCharToMultiByte(CP_ACP, 0, data, -1, NULL, 0, NULL, NULL); #else - name_len = data_len + 1; + name_len = data_len + 1; #endif - if (!(name = malloc(name_len))) { - SET_ERROR(ret, SP_ERR_MEM, "registry port name malloc failed"); - goto out; - } + if (!(name = malloc(name_len))) { + SET_ERROR(ret, SP_ERR_MEM, "registry port name malloc failed"); + goto out; + } #ifdef UNICODE - WideCharToMultiByte(CP_ACP, 0, data, -1, name, name_len, NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, data, -1, name, name_len, NULL, NULL); #else - strcpy(name, data); + strcpy(name, data); #endif DEBUG_FMT("Found port %s", name); if (!(*list = list_append(*list, name))) {