]> Git Repo - qemu.git/blobdiff - HACKING
usb-redir: Change usbredir_open_chardev into usbredir_create_parser
[qemu.git] / HACKING
diff --git a/HACKING b/HACKING
index 471cf1d1970959e95ba18aa8abd798bb5240d95b..dddd617a6b3c4907ac28806f7e8734773a9d1379 100644 (file)
--- a/HACKING
+++ b/HACKING
@@ -91,10 +91,11 @@ emulators.
 
 4. String manipulation
 
-Do not use the strncpy function.  According to the man page, it does
-*not* guarantee a NULL-terminated buffer, which makes it extremely dangerous
-to use.  Instead, use functionally equivalent function:
-void pstrcpy(char *buf, int buf_size, const char *str)
+Do not use the strncpy function.  As mentioned in the man page, it does *not*
+guarantee a NULL-terminated buffer, which makes it extremely dangerous to use.
+It also zeros trailing destination bytes out to the specified length.  Instead,
+use this similar function when possible, but note its different signature:
+void pstrcpy(char *dest, int dest_buf_size, const char *src)
 
 Don't use strcat because it can't check for buffer overflows, but:
 char *pstrcat(char *buf, int buf_size, const char *s)
This page took 0.024259 seconds and 4 git commands to generate.