Browse Source

Maybe it will work now?

MissValeska 10 years ago
parent
commit
2c1bdf5990
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      src/inet.c

+ 3
- 2
src/inet.c View File

@@ -1109,7 +1109,8 @@ inet_sendto(int s, const void *msg, size_t len, int flags,
1109 1109
 			const struct sockaddr * to, socklen_t tolen)
1110 1110
 {
1111 1111
 	ssize_t err;
1112
-	char * ipv4_addr;
1112
+	char *ipv4_addr;
1113
+        size_t maxlen;
1113 1114
 	if ((err = sendto(s, msg, len, flags, to, tolen)) == -1) {
1114 1115
 		switch (errno) {
1115 1116
 		case EMSGSIZE:
@@ -1123,7 +1124,7 @@ inet_sendto(int s, const void *msg, size_t len, int flags,
1123 1124
                                 "and: %s", to->sa_family, 
1124 1125
                                 inet_ntop(to->sa_family,
1125 1126
                                 &(((struct sockaddr_in*)to)->sin_addr),
1126
-                                ipv4_addr, sizeof ipv4_addr),
1127
+                                ipv4_addr, maxlen),
1127 1128
                                 strerror(errno));
1128 1129
 		default:
1129 1130
 			error("inet_sendto: Cannot send(): %s", strerror(errno));

Loading…
Cancel
Save