summaryrefslogtreecommitdiffstats
path: root/src/shared/sockhelper.c
diff options
context:
space:
mode:
authorSimon Rettberg2015-11-30 13:59:05 +0100
committerSimon Rettberg2015-11-30 13:59:05 +0100
commit9ffb0038ded686a177b06f268f08c9bcd48128b2 (patch)
tree8d50f7f92db37b2ce9a9e0933072f4203d587ac6 /src/shared/sockhelper.c
parent[FUSE] Mid-refactoring, does not compile (diff)
downloaddnbd3-9ffb0038ded686a177b06f268f08c9bcd48128b2.tar.gz
dnbd3-9ffb0038ded686a177b06f268f08c9bcd48128b2.tar.xz
dnbd3-9ffb0038ded686a177b06f268f08c9bcd48128b2.zip
[FUSE] Compiles again
Diffstat (limited to 'src/shared/sockhelper.c')
-rw-r--r--src/shared/sockhelper.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/sockhelper.c b/src/shared/sockhelper.c
index 0b7a1db..3748d38 100644
--- a/src/shared/sockhelper.c
+++ b/src/shared/sockhelper.c
@@ -1,5 +1,5 @@
#include "sockhelper.h"
-//#include "log.h"
+#include "log.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h> // inet_ntop
@@ -80,7 +80,7 @@ int sock_resolveToDnbd3Host(const char * const address, dnbd3_host_t * const des
// See if we have a port
snprintf( bufferAddr, sizeof bufferAddr, "%s", address );
- const char *c1, *c2;
+ char *c1, *c2;
c1 = strchr( addr, ':' );
if ( c1 != NULL ) {
c2 = strchr( c1 + 1, ':' );
@@ -93,8 +93,8 @@ int sock_resolveToDnbd3Host(const char * const address, dnbd3_host_t * const des
c1 = strchr( c2 + 1, ':' );
if ( c1 != NULL ) c2 = c1;
} while ( c1 != NULL );
- if ( c2[-1] == ']' ) {
- c2[-1] = '\0';
+ if ( *(c2 - 1 ) == ']' ) {
+ *( c2 - 1 ) = '\0';
*c2 = '\0';
addr += 1;
portStr = c2 + 1;