asalamon74 / pktriggercord

Remote control for Pentax DSLR cameras
http://pktriggercord.melda.info
GNU Lesser General Public License v3.0
103 stars 38 forks source link

Replace strncpy() with memcpy() in pslr_scsi_linux.c. #56

Closed sh0 closed 4 years ago

sh0 commented 4 years ago

Compilers like recent GCC versions will complain about using strncpy() in pslr_scsi_linux.c. This is because strncpy() is traditionally used with length argument dependent on destination string length. In this code, however, the length is dependent on source string size. It is therefore recommended to use memcpy() instead.

I have no way of testing this change, but it is very straightforward so I'm confident that it will not cause issues.

asalamon74 commented 4 years ago

Thanks for all the PRs, I really like the code cleanups. I'll check them one by one as I have time (it will probably take some time).

I've committed this one.