#include <wctype.h>
#include <pwd.h>
#include <string.h>
-#include <malloc.h>
#include <stdio.h>
#ifdef HAVE_CONFIG_H
#endif
#include <doldaconnect/uilib.h>
#include <doldaconnect/uimisc.h>
-#include <doldaconnect/utils.h>
+#include <utils.h>
#ifdef HAVE_KRB5
#include <krb5.h>
int valid, fwd, fwded;
};
-static char *hexencode(char *data, size_t datalen)
-{
- char *buf, this;
- size_t bufsize, bufdata;
- int dig;
-
- buf = NULL;
- bufsize = bufdata = 0;
- for(; datalen > 0; datalen--, data++)
- {
- dig = (*data & 0xF0) >> 4;
- if(dig > 9)
- this = 'A' + dig - 10;
- else
- this = dig + '0';
- addtobuf(buf, this);
- dig = *data & 0x0F;
- if(dig > 9)
- this = 'A' + dig - 10;
- else
- this = dig + '0';
- addtobuf(buf, this);
- }
- addtobuf(buf, 0);
- return(buf);
-}
-
-static char *hexdecode(char *data, size_t *len)
-{
- char *buf, this;
- size_t bufsize, bufdata;
-
- buf = NULL;
- bufsize = bufdata = 0;
- for(; *data; data++)
- {
- if((*data >= 'A') && (*data <= 'F'))
- {
- this = (this & 0x0F) | ((*data - 'A' + 10) << 4);
- } else if((*data >= '0') && (*data <= '9')) {
- this = (this & 0x0F) | ((*data - '0') << 4);
- } else {
- if(buf != NULL)
- free(buf);
- return(NULL);
- }
- data++;
- if(!*data)
- {
- if(buf != NULL)
- free(buf);
- return(NULL);
- }
- if((*data >= 'A') && (*data <= 'F'))
- {
- this = (this & 0xF0) | (*data - 'A' + 10);
- } else if((*data >= '0') && (*data <= '9')) {
- this = (this & 0xF0) | (*data - '0');
- } else {
- if(buf != NULL)
- free(buf);
- return(NULL);
- }
- addtobuf(buf, this);
- }
- addtobuf(buf, 0);
- if(len != NULL)
- *len = bufdata - 1;
- return(buf);
-}
-
static void process_krb5(struct dc_response *resp, struct logindata *data)
{
int ret;
return(wcscmp(l1->argv[1], l2->argv[1]));
}
-static int sortlist2(const struct dc_fnetpeer *p1, const struct dc_fnetpeer *p2)
+static int sortlist2(const struct dc_fnetpeer **p1, const struct dc_fnetpeer **p2)
{
- return(wcscmp(p1->id, p2->id));
+ return(wcscmp((*p1)->id, (*p2)->id));
}
static void fillpeer(struct dc_fnetpeer *peer, struct dc_respline *r)
delpeer(plist[o]);
o++;
} else {
+ fillpeer(plist[o], resp->rlines + i);
i++;
o++;
- fillpeer(plist[o], resp->rlines + i);
}
} else if(i < resp->numlines) {
peer = addpeer(fn, resp->rlines[i].argv[1], resp->rlines[i].argv[2]);