[Swan-dev] [Swan-commit] Changes to ref refs/heads/master

D. Hugh Redelmeier hugh at mimosa.com
Tue Jan 19 19:18:56 UTC 2016


| From: Andrew Cagney <andrew.cagney at gmail.com>

| I'm testing a change that accumulates the ascii representation of the
| entire remote SA payload into that buffer. If no proposals match it
| will get logged as a single line.

Is there a reasonable limit one should follow for the width of a log
line?  I've developed a bunch of superstitions over the years but
nothing concrete.  1024 seems wide but my guess that up to 4k might be
safe (but inhumane).

| Anyway, this is all mute as I'm going to move the structure to the
| heap: tiny uClinux stack; and buffers on the stack just scare me.

Yes.  The heap scares me in different ways.

If you are going to use the heap, it is almost as easy to expand the
buffer as it is to deal with overflow.  You can arrange the code so
that even the first allocation is a kind of overflow.

I admit that the current form with snprintf-before-checking would need
to be reworked.
	do {} while (!print_joint(...));
and print_join would need to return TRUE on -1 case.  Or print_join
could absorb the role of snprintf, with all the varargs horror.

| Yes, constantly having to re-work important patches because someone
| keeps tinkering with the colours gets tedious.

Ahh.  Sorry.  I thought that since it was in master it was fair game.


More information about the Swan-dev mailing list