Projects
home:pandora:RobinOS23
gpm
_service:download_src_package:0009-if-you-re-us...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:download_src_package:0009-if-you-re-using-strlen-on-it-as-we-are-in-tp_serial_.patch of Package gpm
From bd582fc77acc3ee71da083bf430e12324c44245e Mon Sep 17 00:00:00 2001 From: nick black <nick.black@sprezzatech.com> Date: Fri, 8 Feb 2013 06:06:34 -0500 Subject: [PATCH 09/28] if you're using strlen() on it, as we are in tp_serial_send_cmd(), it had better be a plain char. make it so, killing one warning. no reason to sprintf() into an unsigned char buffer, so make it not, killing the other. this cleans all warnings from synaptic.c using gcc 3.7.2 --- src/synaptics.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/synaptics.c b/src/synaptics.c index 2418c75..a978ef0 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -214,6 +214,7 @@ #include <stdlib.h> #include <unistd.h> #include <string.h> +#include <limits.h> #include <sys/time.h> #include <sys/ioctl.h> @@ -2241,8 +2242,7 @@ static void syn_process_config (info_type ident, -static unsigned char tp_hextoint (unsigned char byte1, - unsigned char byte2) +static unsigned char tp_hextoint (unsigned byte1,unsigned byte2) { unsigned char bytes [3]; int result; @@ -2250,7 +2250,7 @@ static unsigned char tp_hextoint (unsigned char byte1, bytes [0] = byte1; bytes [1] = byte2; bytes [2] = '\0'; - sscanf (bytes, "%x", &result); + sscanf ((char *)bytes, "%x", &result); return result; } @@ -2311,8 +2311,7 @@ static void tp_serial_read (int fd, } /* Write a string of commands */ -static void tp_serial_send_cmd(int fd, - unsigned char *cmd) +static void tp_serial_send_cmd(int fd, const char *cmd) { unsigned char junk [15]; @@ -2329,7 +2328,7 @@ static void tp_serial_send_cmd(int fd, static void syn_serial_set_mode (int fd, unsigned char mode) { - unsigned char bytes [15]; + char bytes [15]; sprintf (bytes, "%%C3B%02X5555", mode); #if DEBUG_SENT_DATA -- 2.19.1.6.gb485710b
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2