Commit e00bb0e9 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

ioat/kperf: replace sprintf() with snprintf()



Change-Id: Ifb3170a49cc388da30a080c9e6df293bf945c81a
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent d540f448
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -332,14 +332,14 @@ int main(int argc, char *argv[])

	for (i = 0; i < threads; i++) {
		/* total data transfer length for the DMA channel in Bytes */
		sprintf(channel, "/sys/kernel/debug/dmaperf/dmaperf/thread_%u/copied", i);
		snprintf(channel, sizeof(channel), "/sys/kernel/debug/dmaperf/dmaperf/thread_%u/copied", i);
		rc = get_u64_from_file(channel, &copied);
		if (rc < 0) {
			fprintf(stderr, "Cannot get channel copied data\n");
			return -1;
		}
		/* time in microseconds for total data transfer length */
		sprintf(channel, "/sys/kernel/debug/dmaperf/dmaperf/thread_%u/elapsed_time", i);
		snprintf(channel, sizeof(channel), "/sys/kernel/debug/dmaperf/dmaperf/thread_%u/elapsed_time", i);
		/* elapsed_time is in microsecond */
		rc = get_u64_from_file(channel, &elapsed_time);
		if (rc < 0) {