open-zwave/debian/patches/gcc8.patch

41 lines
1.7 KiB
Diff

Description: avoid FTBFS with gcc8
Author: Thorsten Alteholz <debian@alteholz.de>
#Index: openzwave-1.5+ds/cpp/build/support.mk
#===================================================================
#--- openzwave-1.5+ds.orig/cpp/build/support.mk 2018-07-09 13:53:57.470848046 +0200
#+++ openzwave-1.5+ds/cpp/build/support.mk 2018-07-09 13:53:57.458848046 +0200
#@@ -50,9 +50,9 @@
# CXX := $(CROSS_COMPILE)c++
# LD := $(CROSS_COMPILE)c++
# else
#-CC := $(CROSS_COMPILE)gcc
#-CXX := $(CROSS_COMPILE)g++
#-LD := $(CROSS_COMPILE)g++
#+CC := $(CROSS_COMPILE)gcc-8
#+CXX := $(CROSS_COMPILE)g++-8
#+LD := $(CROSS_COMPILE)g++-8
# endif
# ifeq ($(UNAME),Darwin)
# AR := libtool -static -o
Index: openzwave-1.5+ds/cpp/src/command_classes/DoorLockLogging.cpp
===================================================================
--- openzwave-1.5+ds.orig/cpp/src/command_classes/DoorLockLogging.cpp 2018-07-09 13:53:57.470848046 +0200
+++ openzwave-1.5+ds/cpp/src/command_classes/DoorLockLogging.cpp 2018-07-09 14:46:19.842753846 +0200
@@ -304,12 +304,14 @@
}
uint8 userid = (_data[10]);
uint8 usercodelength = (_data[11]);
- char usercode[254];
+ #define USERCODESIZE 254
+ char usercode[USERCODESIZE], tmpusercode[USERCODESIZE+4];
snprintf(usercode, sizeof(usercode), "UserCode:");
if (usercodelength > 0)
for (int i = 0; i < usercodelength; i++ )
{
- snprintf(usercode, sizeof(usercode), "%s %d", usercode, (int)_data[12+i]);
+ snprintf(tmpusercode, sizeof(tmpusercode), "%s %d", usercode, (int)_data[12+i]);
+ snprintf(usercode, USERCODESIZE, "%.253s",tmpusercode);
}
if (valid) {