aboutsummaryrefslogtreecommitdiff
path: root/form_shortpwd.c
blob: 63f0139c551c5637592d7b74c4a31c8664b6b87d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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;
}