From 74f19a502a513258f88a75e057a5998393e3c7f6 Mon Sep 17 00:00:00 2001 From: zecke Date: Tue, 13 Jul 2004 13:24:59 +0000 Subject: Use snprintf to just be sure that we don't go over the buffer limit --- diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp index 76f03a0..e62ea18 100644 --- a/libopie2/opiecore/device/odevice_simpad.cpp +++ b/libopie2/opiecore/device/odevice_simpad.cpp @@ -355,7 +355,7 @@ bool SIMpad::setDisplayBrightness ( int bright ) value = value << 8; value += mask; char writeCommand[100]; - const int count = sprintf( writeCommand, "0x%x\n", value ); + const int count = snprintf( writeCommand, sizeof(writeCommand), "0x%x\n", value ); res = ( ::write ( fd, writeCommand, count ) != -1 ); ::close ( fd ); } -- cgit v0.9.0.2