mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2025-05-18 12:02:53 +02:00
fix(solutions): memory issues thanks to -fsanitize=address flag with gcc
This commit is contained in:
@ -1,6 +1,11 @@
|
||||
#ifndef __CHARACTER__
|
||||
#define __CHARACTER__
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "string.h"
|
||||
|
||||
/**
|
||||
* @brief Append a character to a string, assuming string points to an array
|
||||
* with enough space.
|
||||
@ -10,4 +15,13 @@
|
||||
*/
|
||||
void character_append(char* string, char character);
|
||||
|
||||
/**
|
||||
* @brief Append a character to a string at a specific index, assuming string points to an array with enough space.
|
||||
*
|
||||
* @param string
|
||||
* @param character
|
||||
* @param index
|
||||
*/
|
||||
void character_append_at(char* string, const char character, const size_t index);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user