diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-09-22 17:32:44 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2026-02-13 09:57:39 +0100 |
| commit | 78bf2fe4a5bf37514f6dfd203ef969da0bf40c2e (patch) | |
| tree | 33f9440b8ee0fa7a3b3ad033616d722d2101bb4d /form_shortpwd.c | |
| parent | 107a2e43d54f9a42fb85b00b83cb0d9abb194680 (diff) | |
Diffstat (limited to 'form_shortpwd.c')
| -rw-r--r-- | form_shortpwd.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/form_shortpwd.c b/form_shortpwd.c new file mode 100644 index 0000000..63f0139 --- /dev/null +++ b/form_shortpwd.c @@ -0,0 +1,21 @@ +#include "form.h" +#include "defs.h" +#include <libweb/http.h> + +int form_shortpwd(struct http_response *const r) +{ + int ret; + struct dynstr d; + + dynstr_init(&d); + + if (dynstr_append(&d, "Password is too short, minimum %d bytes", MINPWDLEN)) + { + fprintf(stderr, "%s: dynstr_append failed\n", __func__); + return -1; + } + + ret = form_badreq(d.str, r); + dynstr_free(&d); + return ret; +} |
