Mercurial > masqmail-0.2
view src/base64/base64enc.c @ 80:e5090ac234cf
refactoring plus one small bugfix
replaced deep nested conditionals with early exits
fixed a small bug in the same go (Note: it is bad to fix
bugs during refactoring): The SMTP_HELO case did not break
in case of error. Now it does.
author | meillo@marmaro.de |
---|---|
date | Sat, 19 Jun 2010 11:11:28 +0200 |
parents | 26e34ae9a3e3 |
children |
line wrap: on
line source
#include <glib.h> #include <stdio.h> #include <stdlib.h> #include "base64.h" int main() { gchar in[58]; gint size; do { gchar *out; size = fread(in, 1, 54, stdin); out = base64_encode(in, size); fputs(out, stdout); putchar('\n'); g_free(out); } while (size == 54); exit(0); }