Browse Source

hid: Treat null-length strings as missing entirely

Luke Dashjr 12 years ago
parent
commit
f4de915b3e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lowl-hid.c

+ 1 - 1
lowl-hid.c

@@ -123,7 +123,7 @@ bool hidapi_load_library()
 static
 static
 char *wcs2str_dup(wchar_t *ws)
 char *wcs2str_dup(wchar_t *ws)
 {
 {
-	if (!ws)
+	if (!(ws && ws[0]))
 		return NULL;
 		return NULL;
 	
 	
 	char *rv;
 	char *rv;