Skip to content

Instantly share code, notes, and snippets.

View Ximaz's full-sized avatar
☢️
Testing in prod...

DURAND Malo Ximaz

☢️
Testing in prod...
View GitHub Profile
@Ximaz
Ximaz / string_replace_with.c
Last active June 16, 2022 22:12
A string replace implementation in C
#include <stdlib.h>
#include <string.h>
char *replace_with(char *dest, char const *old, char const *new)
{
size_t tail_len = 0;
size_t old_len = strlen(old);
size_t new_len = strlen(new);
char *match;