- Timestamp:
- 07/20/16 16:01:58 (5 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, master, ndag_format, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- 000726a
- Parents:
- 733c8b4 (diff), 2b0eae9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/tutorial/sourcedemo.c
r8835f5a ree0805a 28 28 static inline void print_ip(struct sockaddr *ip) { 29 29 30 char str[ 20];30 char str[40]; 31 31 32 32 /* Check the sockaddr family so we can cast it to the appropriate … … 37 37 /* Use inet_ntop to convert the address into a string using 38 38 * dotted decimal notation */ 39 printf("%s ", inet_ntop(AF_INET, &(v4->sin_addr), str, 20));39 printf("%s ", inet_ntop(AF_INET, &(v4->sin_addr), str, sizeof(str))); 40 40 } 41 41 … … 45 45 /* Use inet_ntop to convert the address into a string using 46 46 * IPv6 address notation */ 47 printf("%s ", inet_ntop(AF_INET6, &(v6->sin6_addr), str, 20));47 printf("%s ", inet_ntop(AF_INET6, &(v6->sin6_addr), str, sizeof(str))); 48 48 } 49 49
Note: See TracChangeset
for help on using the changeset viewer.