From d29ec56d41874eec163239a0344cbc74f3ad0708 Mon Sep 17 00:00:00 2001 From: Vic Yang Date: Tue, 3 Jul 2012 10:52:09 +0800 Subject: [PATCH] Remove hardcoded size in temp_sensor_command_get_info() BUG=chrome-os-partner:11053 TEST='ectool tempsinfo 0' works. Change-Id: Ia4f33f2fce3b38ac7bfeaff0fdd4ef0840a0b58f Reviewed-on: https://gerrit.chromium.org/gerrit/26639 Reviewed-by: Randall Spangler Commit-Ready: Vic Yang Tested-by: Vic Yang --- common/temp_sensor_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/temp_sensor_commands.c b/common/temp_sensor_commands.c index be0a2d5723..bf303f2cb7 100644 --- a/common/temp_sensor_commands.c +++ b/common/temp_sensor_commands.c @@ -27,7 +27,7 @@ int temp_sensor_command_get_info(uint8_t *data, int *resp_size) if (id >= TEMP_SENSOR_COUNT) return EC_RES_ERROR; - strzcpy(r->sensor_name, temp_sensors[id].name, 30); + strzcpy(r->sensor_name, temp_sensors[id].name, sizeof(r->sensor_name)); r->sensor_type = temp_sensors[id].type; *resp_size = sizeof(struct ec_response_temp_sensor_get_info);