[libxml2] Fix Windows compiler warnings in xmlCanonicPath
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Fix Windows compiler warnings in xmlCanonicPath
- Date: Mon, 9 Oct 2017 15:08:19 +0000 (UTC)
commit 41c0a13fe7455bbdd3aa785a67ded91058f81333
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Mon Oct 9 13:32:20 2017 +0200
Fix Windows compiler warnings in xmlCanonicPath
The code handling Windows paths assigned some char/xmlChar pointers
without explicit casts. Also remove an unused variable.
uri.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/uri.c b/uri.c
index 62bedd1..84e420a 100644
--- a/uri.c
+++ b/uri.c
@@ -2394,8 +2394,7 @@ xmlCanonicPath(const xmlChar *path)
*/
#if defined(_WIN32) && !defined(__CYGWIN__)
int len = 0;
- int i = 0;
- xmlChar *p = NULL;
+ char *p = NULL;
#endif
xmlURIPtr uri;
xmlChar *ret;
@@ -2477,7 +2476,7 @@ path_processing:
len = xmlStrlen(path);
if ((len > 2) && IS_WINDOWS_PATH(path)) {
/* make the scheme 'file' */
- uri->scheme = xmlStrdup(BAD_CAST "file");
+ uri->scheme = (char *) xmlStrdup(BAD_CAST "file");
/* allocate space for leading '/' + path + string terminator */
uri->path = xmlMallocAtomic(len + 2);
if (uri->path == NULL) {
@@ -2487,9 +2486,9 @@ path_processing:
/* Put in leading '/' plus path */
uri->path[0] = '/';
p = uri->path + 1;
- strncpy(p, path, len + 1);
+ strncpy(p, (char *) path, len + 1);
} else {
- uri->path = xmlStrdup(path);
+ uri->path = (char *) xmlStrdup(path);
if (uri->path == NULL) {
xmlFreeURI(uri);
return(NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]