lnls-dig / halcs

Hardware Abstraction Layer for Control Systems
GNU General Public License v3.0
1 stars 4 forks source link

[CLOSED] [all] Replace all unsafe C functions #84

Closed lerwys closed 8 years ago

lerwys commented 8 years ago

Issue by lerwys Monday Mar 16, 2015 at 03:13 GMT Originally opened as https://github.com/lnls-dig/bpm-sw/issues/84


Problems: There are some uses of unsafe C functions like strcat () and strcpy () on the code, which could lead to bugs.

Solution: Replace the unsafe functions by its safe counterparts, like strncat () and strncpy ()

lerwys commented 8 years ago

Comment by lerwys Friday Apr 10, 2015 at 17:24 GMT


Actually, this is wrong. We should use something else for this. strlcpy () should be a little better for this, but it's not very standard. So, we we should use a slower (much slower for small strings, apparently) function like snprintf () for now.