From 539f267101fc33337899c09063578c60a454bfb3 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Thu, 18 Jan 2024 22:32:49 +0100 Subject: [PATCH] allocate max size user and password --- src/kds_s2000w_net.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); -- 2.39.5