On Sat, Mar 1, 2014 at 12:08 PM, Boris Faure <[email protected]> wrote: > billiob pushed a commit to branch master. > > http://git.enlightenment.org/apps/terminology.git/commit/?id=42e4fdfc597be278685f08bdba6da781c4ebaac0 > > commit 42e4fdfc597be278685f08bdba6da781c4ebaac0 > Author: Boris Faure <[email protected]> > Date: Sat Mar 1 15:29:32 2014 +0100 > > improve debug for unhandled csi > --- > src/bin/termptyesc.c | 23 +++++++++++++++++++---- > 1 file changed, 19 insertions(+), 4 deletions(-) > > diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c > index a472143..1ea1398 100644 > --- a/src/bin/termptyesc.c > +++ b/src/bin/termptyesc.c > @@ -337,8 +337,9 @@ static int > _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce) > { > Eina_Unicode *cc; > - int arg, i; > + int arg, i, j; > Eina_Unicode buf[4096], *b; > + char *pos; ... > + pos = (char *)buf; ... > + pos += sprintf(pos, "\033[35m%08x\033[0m", c[j]); > + else > + pos += sprintf(pos, "%c", c[j]);
you just created a monster using those cast. Okay, buf is 4096 and you check boundaries using that exact number, but god why abuse this? I'd say replace this with eina_strbuf as it will simplify and avoid hacks at the expense of malloc(), but since this is error handling it shouldn't be a big deal of performance. -- Gustavo Sverzut Barbieri -------------------------------------- Mobile: +55 (19) 9225-2202 Contact: http://www.gustavobarbieri.com.br/contact ------------------------------------------------------------------------------ Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce. With Perforce, you get hassle-free workflows. Merge that actually works. Faster operations. Version large binaries. Built-in WAN optimization and the freedom to use Git, Perforce or both. Make the move to Perforce. http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
