Last active
November 12, 2022 06:04
-
-
Save ohmypxl/30daf34024130f7d928d7075e2056b68 to your computer and use it in GitHub Desktop.
Untested, by theory it should give output like: 192.168.x.1 or 156.242.xxx.xx1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CensorIp(ip[]) | |
{ | |
if (!IsValidIp(ip)) | |
return 0; | |
for (new i = 0, j = strlen(ip), k = 0; i < j; i++) | |
{ | |
if (ip[i] == '.') | |
{ | |
k ++; | |
continue; | |
} | |
if (k >= 2 && i < j - 1) | |
{ | |
ip[i] = 'x'; | |
} | |
} | |
return 1; | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment