From 7886011de284310be2a593d5252d073481fe43b4 Mon Sep 17 00:00:00 2001 From: Cedric Roux <cedric.roux@eurecom.fr> Date: Wed, 11 Dec 2013 20:10:05 +0000 Subject: [PATCH] - Fix embedded \0 in format - Fix USER_MODE warning git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4678 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- openair1/PHY/LTE_TRANSPORT/print_stats.c | 8 +++++--- openair3/RAL-LTE/INTERFACE-802.21/INCLUDE/MIH_C_Types.h | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/print_stats.c b/openair1/PHY/LTE_TRANSPORT/print_stats.c index 724413d4c3..5924c4a517 100644 --- a/openair1/PHY/LTE_TRANSPORT/print_stats.c +++ b/openair1/PHY/LTE_TRANSPORT/print_stats.c @@ -252,7 +252,8 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t } len += sprintf(&buffer[len],"EOF\n"); - len += sprintf(&buffer[len],"\0"); + /* SR: for trailing '\0' */ + len ++; return len; } // is_clusterhead @@ -478,7 +479,8 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length) { len += sprintf(&buffer[len],"\n"); } len += sprintf(&buffer[len],"EOF\n"); - len += sprintf(&buffer[len],"\0"); - + /* SR: for trailing '\0' */ + len++; + return len; } diff --git a/openair3/RAL-LTE/INTERFACE-802.21/INCLUDE/MIH_C_Types.h b/openair3/RAL-LTE/INTERFACE-802.21/INCLUDE/MIH_C_Types.h index 797983a245..08d0cf5573 100755 --- a/openair3/RAL-LTE/INTERFACE-802.21/INCLUDE/MIH_C_Types.h +++ b/openair3/RAL-LTE/INTERFACE-802.21/INCLUDE/MIH_C_Types.h @@ -20,10 +20,11 @@ Type definition and structure for 802.21 interface #define __MIH_C_LINK_TYPES_H__ #include <sys/types.h> #include <linux/types.h> -#warning " Hack USER_MODE" -#undef USER_MODE -#define USER_MODE +#ifndef USER_MODE +# define USER_MODE +# warning "Hack USER_MODE" +#endif //----------------------------------------------------------------------------- #include "MIH_C_Link_Constants.h" #include "MIH_C_bit_buffer.h" -- GitLab