aboutsummaryrefslogtreecommitdiff
path: root/form_shortpwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'form_shortpwd.c')
-rw-r--r--form_shortpwd.c21
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;
+}