user and password cfg parser error
Brought to you by:
num6
ag 0.2 wouldn't log in, complaining that the user/password
were invalid. I took a look in agqt/ag/cfgfile.cc
and found that the trailing EOL got duped by
strdup (atleast on this glibc, Linux libc5 5.4.46-3,
GNU libc6 2.2.1-1).
It was easy to fix it:
if (!strncasecmp(t, "username ", 9))
{
char *tok = t + 9;
----->>>> tok[strlen(tok) - 1] = '\0';
myConfig->userName = strdup(tok);
}
else if (!strncasecmp(t, "password ", 9))
{
char *tok = t + 9;
----->>>> tok[strlen(tok) - 1] = '\0';
myConfig->password = strdup(tok);
}
etc for the parser.
a_very@mad.scientist.com
Logged In: NO
Thanks ! Solved my problem as well !