From be523f1fe7c136c3fca06ae9c96aff44a22482ba Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Fri, 6 Aug 2010 21:56:04 -0600 Subject: [PATCH] Windows: fix string copy in sanitize_path The NULL byte was not being copied. --- libusb/os/windows_usb.c | 2 +- libusb/os/windows_usb.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c index 14c2d7b..210a1fe 100644 --- a/libusb/os/windows_usb.c +++ b/libusb/os/windows_usb.c @@ -239,7 +239,7 @@ static char* sanitize_path(const char* path) if ((ret_path = (char*)calloc(size, 1)) == NULL) return NULL; - safe_strncpy(&ret_path[add_root], size-add_root, path, strlen(path)); + safe_strcpy(&ret_path[add_root], size-add_root, path); // Ensure consistancy with root prefix for (j=0; j":str1), ((str2==NULL)?"":str2)) -- 2.7.4