> > You really should explain here why we change from filling with spaces to > > filling with nuls. > I guess that a commit-comment would still be needed, but I think that a > more conventional approach could make it all clearer: > > - memset(ve->name, ' ', 16); > - if (name) > - strncpy(ve->name, name, 16); > + int l = strnlen(ve->name, 16); > + memcpy(ve->name, name, l); > + if (l < 16) /* no null-termination expected when all the space is used */ > + ve->name[l] = '\0'; > > Cheers, > Gal my bad - I obviously meant strnlen(name, 16).