File 0001-Fix-error-message-concatenation.patch of Package med-tools
From beb3e99dbf1b01c52e6a9d3c1c4409f15a789f28 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Fri, 15 Feb 2019 18:10:26 +0100
Subject: [PATCH 1/5] Fix error message concatenation
The erroneous message expands to '"de type " -19', which is a char*
pointing to some random data in front of the message, while the wanted
message is just the concatenation '"de type " "d'attribut "'.
This is reported by GCC as
warning: array subscript is below array bounds [-Warray-bounds]
---
src/ci/MEDstructElementVarAttCr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ci/MEDstructElementVarAttCr.c b/src/ci/MEDstructElementVarAttCr.c
index d42cb3f..44d2a9f 100644
--- a/src/ci/MEDstructElementVarAttCr.c
+++ b/src/ci/MEDstructElementVarAttCr.c
@@ -69,7 +69,7 @@ if (_MEDcheckVersion30(fid) < 0) goto ERROR;
NOFINALBLANK(varattname,ERROR);
if ( _medintvaratttype == MED_ATT_UNDEF ) {
- MED_ERR_(_ret,MED_ERR_INVALID, MED_ERR_PARAMETER, MED_ERR_TYPEOF_MSG MED_ERR_ATTRIBUTE);
+ MED_ERR_(_ret,MED_ERR_INVALID, MED_ERR_PARAMETER, MED_ERR_TYPEOF_MSG MED_ERR_ATTRIBUTE_MSG);
SSCRUTE(MED_NOM_ATT);SSCRUTE(varattname);ISCRUTE_int(varatttype);
goto ERROR;
}
--
2.20.1