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,8 +1,20 @@
|
||||
#ifndef __STRING__
|
||||
#define __STRING__
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define ALPHABET_LENGTH 26
|
||||
#define ALPHABET "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
|
||||
/**
|
||||
* @brief Return the length of a string (excluding '\0').
|
||||
*
|
||||
* @param string
|
||||
*/
|
||||
size_t string_get_length(const char* string);
|
||||
|
||||
/**
|
||||
* @brief Shift the alphabet by a given amount.
|
||||
*
|
||||
|
Reference in New Issue
Block a user