From b03df1a6ed2d3a0972b286493fb899c8c6455082 Mon Sep 17 00:00:00 2001 From: Bernd Eckenfels Date: Wed, 1 May 2002 11:49:56 +0000 Subject: [PATCH] brken buffer for printed irda address, reported by Christoph Bartelmus --- lib/irda.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/irda.c b/lib/irda.c index fa147fe..598e6f0 100644 --- a/lib/irda.c +++ b/lib/irda.c @@ -1,13 +1,15 @@ /********************************************************************* * * Filename: irda.c - * Version: 0.1 - * Description: A first attempt to make ifconfig understand IrDA + * Version: 0.2 + * Description: A second attempt to make ifconfig understand IrDA * Status: Experimental. * Author: Dag Brattli * Created at: Wed Apr 21 09:03:09 1999 * Modified at: Wed Apr 21 09:17:05 1999 * Modified by: Dag Brattli + * Modified at: Wed May 1 11:51:44 CEST 2002 + * Modified by: Christoph Bartelmus * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -59,9 +61,9 @@ */ static char *irda_print(unsigned char *ptr) { - static char buff[8]; + static char buff[12]; - sprintf(&buff[strlen(buff)], "%02x:%02x:%02x:%02x", ptr[3], ptr[2], + snprintf(buff, 12, "%02x:%02x:%02x:%02x", ptr[3], ptr[2], ptr[1], ptr[0]); return (buff); -- 2.7.4