int len = strlen(name); if (len >= 3) name[3]=NUL;