mirror of
https://github.com/yarrick/iodine.git
synced 2025-12-07 04:41:44 +00:00
#40, fix dots in hostname when length is 113, 170, 227... Includes test.
This commit is contained in:
@@ -52,12 +52,12 @@ inline_dotify(char *buf, size_t buflen)
|
||||
pos = (unsigned) (reader - buf) + 1;
|
||||
|
||||
while (dots) {
|
||||
*writer-- = *reader--;
|
||||
pos--;
|
||||
if (pos % 57 == 0) {
|
||||
*writer-- = '.';
|
||||
dots--;
|
||||
}
|
||||
*writer-- = *reader--;
|
||||
pos--;
|
||||
}
|
||||
|
||||
/* return new length of string */
|
||||
|
||||
Reference in New Issue
Block a user