]> git.pond.sub.org Git - empserver/blobdiff - src/lib/common/file.c
Initialize ef_type and uid automatically in ef_extend()
[empserver] / src / lib / common / file.c
index 090b60622d5d16cc6e8b2df99ec6f7cd3874a643..2a3f26896632783f145c2020f28ce2c3964af5e5 100644 (file)
@@ -475,11 +475,17 @@ static void
 do_blank(struct empfile *ep, void *buf, int id, int count)
 {
     int i;
+    struct emptypedstr *elt;
 
     memset(buf, 0, count * ep->size);
-    if (ep->init) {
-       for (i = 0; i < count; i++)
-           ep->init(id + i, (char *)buf + i * ep->size);
+    for (i = 0; i < count; i++) {
+       elt = (struct emptypedstr *)((char *)buf + i * ep->size);
+       if (ep->flags & EFF_TYPED) {
+           elt->ef_type = ep->uid;
+           elt->uid = id + i;
+       }
+       if (ep->init)
+           ep->init(id + i, (void *)elt);
     }
 }