src: fix formatting nits

Closes #19823
This commit is contained in:
Viktor Szakats 2025-12-03 15:53:46 +01:00
parent 1753de9d7a
commit 0417d323c9
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
52 changed files with 490 additions and 543 deletions

View file

@ -98,17 +98,16 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
buffer[i] = '\0';
break;
}
else
if(buffer[i] == '\b')
/* remove this letter and if this is not the first key, remove the
else if(buffer[i] == '\b')
/* remove this letter and if this is not the first key, remove the
previous one as well */
i = i - (i >= 1 ? 2 : 1);
i = i - (i >= 1 ? 2 : 1);
}
/* since echo is disabled, print a newline */
fputs("\n", tool_stderr);
/* if user did not hit ENTER, terminate buffer */
if(i == buflen)
buffer[buflen-1] = '\0';
buffer[buflen - 1] = '\0';
return buffer; /* we always return success */
}