From: Bastian Dehn Date: Thu, 18 Jan 2024 21:32:49 +0000 (+0100) Subject: allocate max size user and password X-Git-Tag: v1.0.0^2~524 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=539f267101fc33337899c09063578c60a454bfb3;p=sane-kds-s2000w-net.git allocate max size user and password --- diff --git a/src/kds_s2000w_net.c b/src/kds_s2000w_net.c index d31b148..f1945a6 100644 --- a/src/kds_s2000w_net.c +++ b/src/kds_s2000w_net.c @@ -1,11 +1,15 @@ #include +#include #include SANE_Status _sane_kds_s2000w_net_init(SANE_Int * version_code, SANE_Auth_Callback authorize) { + SANE_Char* username = malloc(SANE_MAX_USERNAME_LEN * sizeof(SANE_Char)); + SANE_Char* password = malloc(SANE_MAX_PASSWORD_LEN * sizeof(SANE_Char)); + SANE_String_Const resource = "kds_s2000w_net"; - SANE_Char* user = ""; - SANE_Char* pass = ""; + SANE_Char* user = username; + SANE_Char* pass = password; printf("Hello sane init\n"); authorize(resource, user, pass);