fix the wrong code to set the terminate char

Description:

In mtce/src/hwmon/hwmonThreads.cpp, line 266:
    ++dst_ptr = '\0' ;
should be modified as
    *(++dst_ptr) = '\0' ;
Otherwise the code is useless and will generate a compile error in
  higher version gcc.

Reproduce:

Compile the mcte code with gcc 8.2.1 will cause a compile error.
And after the fix, the error is gone.

Closes-Bug: 1804599
Change-Id: I25df255fb14aa3d96c62927eeb7d3e23ae29af2b
Signed-off-by: Yan Chen <yan.chen@intel.com>
This commit is contained in:
Yan Chen 2018-11-23 01:47:44 +08:00
parent abf0ff3986
commit b2290e4fd9
1 changed files with 1 additions and 1 deletions

View File

@ -263,7 +263,7 @@ void _get_field ( char * src_ptr , int field, char * dst_ptr )
for ( dst_ptr-- ; *dst_ptr == ' ' ; dst_ptr-- ) { *dst_ptr = '\0' ; }
/* terminate the line after the last real non-space char */
++dst_ptr = '\0' ;
*(++dst_ptr) = '\0' ;
return ;