[Tizen 6.0] Enable build with -Wformat-truncation warning 84/222284/1 accepted/tizen/unified/20200114.130626 submit/tizen/20200114.003051
authorMikhail Kashkarov <m.kashkarov@partner.samsung.com>
Wed, 18 Dec 2019 10:55:29 +0000 (13:55 +0300)
committerDongkyun Son <dongkyun.s@samsung.com>
Mon, 13 Jan 2020 06:08:53 +0000 (15:08 +0900)
commit26b1b54bc289cba11d880f7c8e828cba00286bce
tree237b900145427884e84cc1928bdb575d1895c161
parente9847e6471a803b1796292f9aa3e0f02e67b113f
[Tizen 6.0] Enable build with -Wformat-truncation warning

nput_events.c:171:19: error: '%s' directive output may be truncated
writing up to 255 bytes into a region of size 117 [-Werror=format-truncation=]
  171 |       "/dev/input/%s", d->d_name);
      |                   ^~
input_events.c:170:5: note: 'snprintf' output between 12 and 267 bytes
into a destination of size 128
  170 |     snprintf(dev[count].fileName, MAX_FILENAME,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  171 |       "/dev/input/%s", d->d_name);

ui_viewer_data.c:303:3: error: 'strncpy' specified bound depends on the length
of the source argument [-Werror=stringop-overflow=]
  303 |   strncpy(to, str, len);
      |   ^~~~~~~~~~~~~~~~~~~~~
ui_viewer_data.c:302:16: note: length computed here
  302 |   size_t len = strlen(str) + 1;
      |                ^~~~~~~~~~~

Change-Id: Ib009b0d1fb99bfd70f9936546d388fd5b29e80f4
Signed-off-by: Mikhail Kashkarov <m.kashkarov@partner.samsung.com>
daemon/input_events.c
ui_viewer/ui_viewer_data.c