]> sigrok.org Git - libserialport.git/commitdiff
Merge pull request #1 from silverbuddy/master
authorMartin Ling <redacted>
Sat, 22 Mar 2014 07:14:49 +0000 (07:14 +0000)
committerMartin Ling <redacted>
Sat, 22 Mar 2014 07:14:49 +0000 (07:14 +0000)
Win32 issues

serialport.c

index 8393797492a246344d3dfc3ffc6b8940bd7405c3..5a88b407e42eb05baddde41d5713459f21d35f4c 100644 (file)
@@ -389,7 +389,7 @@ enum sp_return sp_list_ports(struct sp_port ***list_ptr)
                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;
 #endif
@@ -626,7 +626,7 @@ enum sp_return sp_open(struct sp_port *port, enum sp_mode flags)
        COMSTAT status;
 
        /* Prefix port name with '\\.\' to work with ports above COM9. */
-       if (!(escaped_port_name = malloc(strlen(port->name + 5))))
+       if (!(escaped_port_name = malloc(strlen(port->name) + 5)))
                RETURN_ERROR(SP_ERR_MEM, "Escaped port name malloc failed");
        sprintf(escaped_port_name, "\\\\.\\%s", port->name);