You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2012/11/12 17:58:00 UTC
svn commit: r1408350 - /qpid/proton/trunk/proton-c/src/util.c
Author: astitcher
Date: Mon Nov 12 16:57:59 2012
New Revision: 1408350
URL: http://svn.apache.org/viewvc?rev=1408350&view=rev
Log:
NO-JIRA: Removed no ANSI index() calls and replaced with ANSI strchr()
Modified:
qpid/proton/trunk/proton-c/src/util.c
Modified: qpid/proton/trunk/proton-c/src/util.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/util.c?rev=1408350&r1=1408349&r2=1408350&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/util.c (original)
+++ qpid/proton/trunk/proton-c/src/util.c Mon Nov 12 16:57:59 2012
@@ -23,11 +23,11 @@
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-#include <strings.h>
#include <sys/types.h>
#include <stdint.h>
#include <ctype.h>
#include <string.h>
+#include <strings.h> // For non C89/C99 strcasecmp
#include <proton/error.h>
#include <proton/util.h>
@@ -85,20 +85,20 @@ void parse_url(char *url, char **scheme,
url = scheme_end + 3;
}
- char *at = index(url, '@');
+ char *at = strchr(url, '@');
if (at) {
*at = '\0';
char *up = url;
*user = up;
url = at + 1;
- char *colon = index(up, ':');
+ char *colon = strchr(up, ':');
if (colon) {
*colon = '\0';
*pass = colon + 1;
}
}
- char *slash = index(url, '/');
+ char *slash = strchr(url, '/');
if (slash) {
*slash = '\0';
*host = url;
@@ -108,7 +108,7 @@ void parse_url(char *url, char **scheme,
*host = url;
}
- char *colon = index(*host, ':');
+ char *colon = strchr(*host, ':');
if (colon) {
*colon = '\0';
*port = colon + 1;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org