[Toybox] New toy: uuen/decode

Erich Plondke erich at wreck.org
Thu Mar 14 19:14:39 PDT 2013


And sorry for not prefixing with "New toy", seems like that is SOP.

Sorry, I'm new here.

On Thu, Mar 14, 2013 at 9:04 PM, Erich Plondke <erich at wreck.org> wrote:
> Looks like I might be a bit late on this browsing the archives... but
> uuencode and uudecode implementations are attached.
>
>
> Both passed basic tests.  Support both base64 and traditional format.
>
> Also, I needed to put parens around min/max, but I think a better
> option was presented that didn't have the duplication problem for
> operands with side effects (like x++)
>
>
> diff -r 3a7defbc671e lib/lib.h
> --- a/lib/lib.h Wed Mar 13 00:39:51 2013 -0500
> +++ b/lib/lib.h Thu Mar 14 20:54:54 2013 -0500
> @@ -177,8 +177,8 @@
>  char* make_human_readable(unsigned long long size, unsigned long unit);
>
>  // useful tools
> -#define min(a,b) (a)<(b) ? (a) : (b)
> -#define max(a,b) (a)>(b) ? (a) : (b)
> +#define min(a,b) ((a)<(b) ? (a) : (b))
> +#define max(a,b) ((a)>(b) ? (a) : (b))
>
>  // cut helper functions
>  unsigned long get_int_value(const char *numstr, unsigned lowrange,
> unsigned highrange);



-- 
--
Why are ``tolerant'' people so intolerant of intolerant people?

 1363313679.0


More information about the Toybox mailing list