Commit 1a8f715c authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Cleanup - invalid #263.

parent 5a0c8ff7
...@@ -2305,16 +2305,22 @@ static void MacroDo( httpd_file_sys_t *p_args, ...@@ -2305,16 +2305,22 @@ static void MacroDo( httpd_file_sys_t *p_args,
break; break;
case MVLC_STRING: case MVLC_STRING:
psz = config_GetPsz( p_intf, m->param1 ); psz = config_GetPsz( p_intf, m->param1 );
snprintf( value, sizeof( value ), "%s", psz ? psz : "" ); if( psz != NULL )
if( psz ) free( psz ); {
strncpy( value, psz,sizeof( value ) );
free( psz );
value[sizeof( value ) - 1] = '\0';
}
else
*value = '\0';
msg_Dbg( p_intf, "%d: value = \"%s\"", __LINE__, value );
break; break;
default: default:
snprintf( value, sizeof( value ), snprintf( value, sizeof( value ),
"invalid type(%s) in set", m->param2 ); "invalid type(%s) in set", m->param2 );
value[sizeof( value ) - 1] = '\0';
break; break;
} }
value[sizeof( value ) - 1] = '\0';
msg_Dbg( p_intf, "get name=%s value=%s type=%s", m->param1, value, m->param2 );
PRINTS( "%s", value ); PRINTS( "%s", value );
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment