mirror of
https://github.com/oliverschmidt/contiki.git
synced 2025-01-02 19:29:30 +00:00
Fixed bug in IPv6 address print function.
This commit is contained in:
parent
063bb12bd0
commit
d57904b289
@ -140,6 +140,7 @@ sprint_ip6(uip_ip6addr_t addr)
|
||||
unsigned char i = 0;
|
||||
unsigned char zerocnt = 0;
|
||||
unsigned char numprinted = 0;
|
||||
unsigned char notskipped = 0;
|
||||
char thestring[40];
|
||||
char *result = thestring;
|
||||
|
||||
@ -149,10 +150,11 @@ sprint_ip6(uip_ip6addr_t addr)
|
||||
while(addr.u16[zerocnt + i] == 0) {
|
||||
zerocnt++;
|
||||
}
|
||||
if(zerocnt == 1) {
|
||||
if(zerocnt == 1 && notskipped) {
|
||||
*result++ = '0';
|
||||
numprinted++;
|
||||
break;
|
||||
notskipped = 1;
|
||||
continue;
|
||||
}
|
||||
i += zerocnt;
|
||||
numprinted += zerocnt;
|
||||
|
Loading…
Reference in New Issue
Block a user