Overview
Artifact ID: | a12aadd18c9568ced71edae8e064a847fd3fd264 |
---|---|
Ticket: | a09798ba9e285df66543f60344e7109fe6ac125c
Bug in ipPrefix (Check-in [86cbb69af2])? |
User & Date: | rwilson 2009-12-29 18:16:42 |
Changes
- Appended to comment:
<hr><i>rwilson added on 2009-12-29 18:16:42:</i><br> i think you are correct. it should be i. as is, this code will always return the first two chars of the ip address. <pre> static char *ipPrefix(const char *zIP){ int i, j; for(i=j=0; zIP[i]; i++){ if( zIP[i]=='.' ){ j++; if( j==2 ) break; } } return mprintf("%.*s", j, zIP); } </pre>
- resolution changed to: "Open"