- strcpy(f->value, tmpline + f->namelen + 1);
- f->valuelen = nchars - f->namelen - 1;
+ if (f->namelen != 0) {
+ strcpy(f->value, tmpline + f->namelen + 1);
+ f->valuelen = nchars - f->namelen - 1;
+ } else {
+ strcpy(f->value, tmpline);
+ f->valuelen = nchars;
+ }