]> granicus.if.org Git - sysstat/commit
sar and pidstat: Check that _("Average") string doesn't exceed
authorSebastien Godard <sysstat@orange.fr>
Tue, 24 May 2011 11:46:17 +0000 (13:46 +0200)
committerSebastien Godard <sysstat@orange.fr>
Tue, 24 May 2011 11:46:17 +0000 (13:46 +0200)
commita7ae5a673a10e329315bd10f9b9e51d2a9d22369
tree6ec1ab7a543e02baeb4c7cf28b5208c8db8e3e0e
parentd6a711acda5eebf6ab23192d6d19dfd858b1a276
sar and pidstat: Check that _("Average") string doesn't exceed
the size of the timestamp buffer.

One could find something like:
strcpy(string, _("Average"));
in pidstat.c and sar.c. Yet, we don't know whether the translation
message for "Average" will fit in target string buffer. Hence we
replaced the previous expression with something like:
strncpy(string, _("Average"), length_of_string_buffer);
string[lenght_of_string_buffer - 1] = '\0';
CHANGES
pidstat.c
sar.c