Skip to content

Instantly share code, notes, and snippets.

View dakotasides's full-sized avatar

Dakota Sides dakotasides

View GitHub Profile
@zedshaw
zedshaw / safercopy_smash.c
Created January 4, 2015 19:07
Demonstration of using a pointer to alter the operation of another function in C.
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#define MAXLINE 10 // in the book this is 1000
void safercopy(size_t to_length, char to[], size_t from_length, char from[])
{
int i = 0;