Opened 6 years ago

Closed 6 years ago

#14155 closed bug (fixed)

Media preference: Replace strncpy with strlcpy

Reported by: mt Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Preferences/Media Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

https://review.haiku-os.org/#/c/haiku/+/211/

Replace strncpy with strlcpy, since destination size equals maximum number of characters to copy. [-Werror=stringop-truncation]

/home/haiku/haiku/haiku/src/preferences/media/MediaWindow.cpp: In member function 'void MediaWindow::_FindNodes(media_type, uint64, MediaWindow::NodeList&)':
/home/haiku/haiku/haiku/src/preferences/media/MediaWindow.cpp:589:10: error: 'char* strncpy(char*, const char*, size_t)' specified bound 64 equals destination size [-Werror=stringop-truncation]
   strncpy(info->name, nodeInfo[i].name, B_MEDIA_NAME_LENGTH);
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change History (1)

comment:1 by waddlesplash, 6 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.