diff --git a/content/posts/secure-coding-in-c-summations-null-terminate-2.md b/content/posts/secure-coding-in-c-summations-null-terminate-2.md index 3497f84..072a66a 100644 --- a/content/posts/secure-coding-in-c-summations-null-terminate-2.md +++ b/content/posts/secure-coding-in-c-summations-null-terminate-2.md @@ -31,7 +31,7 @@ Lets go over each function: ### strcat -``` +```c char *strcat(char *dest, char *src) ``` @@ -48,7 +48,7 @@ Be sure to set the last character to `null` after the `strcat` is completed. ### strncat -``` +```c strncat(char *dest, char *src, size_t src_len) ``` @@ -61,7 +61,7 @@ In addition if `src` is not `null` terminated and `src_len` is longer than the l ### strlcat -``` +```c size_t strlcat(char *dst, const char *src, size_t size) ``` diff --git a/content/posts/secure-coding-in-c-summations-null-terminate.md b/content/posts/secure-coding-in-c-summations-null-terminate.md index 7bc0edf..ffebbd9 100644 --- a/content/posts/secure-coding-in-c-summations-null-terminate.md +++ b/content/posts/secure-coding-in-c-summations-null-terminate.md @@ -31,7 +31,7 @@ Lets go over each function: ### strcpy -``` +```c strcpy(char *dest, char *src) ``` @@ -46,7 +46,7 @@ Arbitrary memory reads can be a problem since it could mean revealing data meant ### strncpy -``` +```c strncpy(char *dest, char *src, size_t dest_len) ``` @@ -60,7 +60,7 @@ So `strncpy` can still read arbitrary memory and can still buffer overflow (tho ### strlcpy -``` +```c size_t strlcpy(char *dst, const char *src, size_t size) ``` @@ -75,7 +75,7 @@ Point two is good so you can compare `size` to the return value to see if the so ### strdup -``` +```c char *strdup(const char *s); ```