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>