fix request_auth not removing the trailing newline from the user name

Tue, 23 Jul 2024 14:29:33 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Tue, 23 Jul 2024 14:29:33 +0200
changeset 824
76ca3dac6506
parent 823
04c60a353331
child 825
ca568c209dfd

fix request_auth not removing the trailing newline from the user name

dav/config.c file | annotate | diff | comparison | revisions
--- a/dav/config.c	Sun Jul 21 23:27:52 2024 +0200
+++ b/dav/config.c	Tue Jul 23 14:29:33 2024 +0200
@@ -604,6 +604,9 @@
     if(!user.ptr) {
         return 0;
     }
+    if(user.length > 0 && user.ptr[user.length-1] == '\n') {
+        user.length--;
+    }
     
     char *password = util_password_input("Password: ");
     if(!password || strlen(password) == 0) {

mercurial