All pastes #904214 Raw Edit

Anonymous

public c v1 · immutable
·published 2008-02-14 20:06 UTC
rendered paste body
#include <stdio.h>#include <stdlib.h>#include <string.h>int main(void){        char *buf = malloc(sizeof(char) * 255);        char *p = buf;        strncpy(buf, "hest", sizeof(char) * 5);        printf("%s\n", buf);        /* indsæt sanity check så p ikke ryger udenfor*/        p += strlen("hest");        strncpy(p, "lalala", sizeof(char) * 7);        printf("%s\n", buf);        return(0);}