0: snprintf() returned 3; buf has [] (0 chars)
1: snprintf() returned 3; buf has [] (0 chars)
2: snprintf() returned 3; buf has [f] (1 chars)
3: snprintf() returned 3; buf has [fo] (2 chars)
4: snprintf() returned 3; buf has [foo] (3 chars)
5: snprintf() returned 3; buf has [foo] (3 chars)