-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
there is some problem with the function "encode_string_as_pointer"!!!!! #439
Comments
Hi, @AIChangjiang , can you provide more information about it, what would happen if not change the original implementation and what bug you occurred when use this function. |
Hello. Thank you for your reply. |
Hi @AIChangjiang , yes, you are right. Here is a snippet I extracted from the rfc6901 document:
According to this, I think the right implement may be as follow:
What's you opinion? |
yes, I think your modifications are correct. That's what I thought. |
it shoud change "~" to "
0",but this function has change "" to "~1", there also have problem with the "/";the right implement may be as follow.
static void encode_string_as_pointer(unsigned char *destination, const unsigned char *source)
{
for (; source[0] != '\0'; (void)source++, destination++)
{
if (source[0] == '/')
{
destination[1] = '
';')destination[1] = '1';
destination++;
}
else if (source[0] == '
{
destination[0] = '~';
destination[1] = '0';
destination++;
}
else
{
destination[0] = source[0];
}
}
}
The text was updated successfully, but these errors were encountered: