Commit Graph

12 Commits

Author SHA1 Message Date
Andrew Pamment
b500a450dd Couple of minor fixes
Duplicate string in www_email
fread returns number of elements read not number of bytes
Missing clear screen after my changing of strings
2018-10-14 10:46:52 +10:00
Dan Cross
2de957db34 Modify HTML generation code to use stralloc.
Replace most remaining uses of sprintf() into a `buffer`
variable followed by realloc() and strcat() with direct
use of stralloc.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-14 10:35:23 +10:00
Dan Cross
42eb413c91 More changing formatting to use stralloc.
Specifically, change the www_last10 HTML rendering logic
to use stralloc and strftime().  This eliminates a lot of
duplication.

It would be easier to test this with a unit test if the
logic of reading the last10 entries from a file were
separated from the HTML rendering logic.  An area for
future enhancement.

Also start in on www_email.c, which is the last bastion
of significant realloc() use for page generation.  An
explicit goal is to get rid of unsafe string handling
functions such as strcpy, strcat, sprintf, etc.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-14 10:35:18 +10:00
Dan Cross
fa014f3a88 Simplify dynamic memory management.
Add utility routines and use them to simplify the
use of dynamically allocated memory.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-10 10:25:29 +10:00
Dan Cross
d6826137dd clang-format
Fix a bunch of trivial formatting issues by running
`clang-format`.

Signed-off-by: Dan Cross <patchdev@fat-dragon.org>
2018-10-09 15:48:42 +10:00
Andrew Pamment
b6f5623826 work on mobile site 2018-01-26 08:19:13 +10:00
Andrew Pamment
14b77790a6 Bootstrap theme and form validation on message entry. 2018-01-25 17:01:19 +10:00
Andrew Pamment
69897e7955 Think I may have fixed it! 2018-01-21 19:05:01 +10:00
Andrew Pamment
aac4aaad00 fix new email link 2018-01-21 15:19:04 +10:00
Andrew Pamment
6ac2e6f125 WWW improvements, fixes and a bug. 2018-01-21 15:02:21 +10:00
Andrew Pamment
a2d80b90fd Add support for US style dates 2017-10-03 12:09:50 +10:00
Andrew Pamment
ffaca86565 Redo Make file setup.. please standby 2017-09-25 13:27:22 +10:00