diff options
author | Pete Batard <pete@akeo.ie> | 2012-06-25 19:13:42 +0100 |
---|---|---|
committer | Pete Batard <pete@akeo.ie> | 2012-07-02 18:28:37 +0100 |
commit | 0e0cbb6c27efa5a2ae58c30267a4be9486c766cc (patch) | |
tree | bb5a0fef2387ff49547595c58d4a90439e1b9460 /examples | |
parent | 89b43a6929305eab8aad297a0ecb58b478857a10 (diff) |
Windows: Address MSVC Level 4 & WDK's OACR/Prefast warnings
* The library is now compiled with warning level 4 for VS2010
* Move silencing of 4200, 28125 and 28719 to msvc/config.h
* Add fixes in core to silence unused variables warnings
* Ensure that spinlock is always set interlocked in poll_windows
* Add missing check for calloc return value
* Fix data assignation in conditionals warnings
* Fix an OACR/Prefast error related to the use of strncpy in xusb.c
* Also fixes whitespace inconsistencies in core
* Issues reported by Orin Eman and Xiaofan Chen. See:
https://sourceforge.net/mailarchive/message.php?msg_id=29412656
Diffstat (limited to 'examples')
-rw-r--r-- | examples/xusb.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/xusb.c b/examples/xusb.c index 8e09e05..0eafd8c 100644 --- a/examples/xusb.c +++ b/examples/xusb.c @@ -935,7 +935,10 @@ int main(int argc, char** argv) break; case 'b': if (j+1 < argc) { - strncpy(binary_name, argv[j+1], 64); + // WDK's OACR doesn't like strncpy... + for (i=0; (i<(sizeof(binary_name)-1)) && (argv[j+1][i] != 0); i++) + binary_name[i] = argv[j+1][i]; + binary_name[i] = 0; j++; } binary_dump = true; |