Browse Source

only mmap a file if its size is larger than 0 bytes

release0.1.5
Georg Hopp 12 years ago
parent
commit
04250fb43a
  1. 2
      src/asset/asset.c

2
src/asset/asset.c

@ -96,6 +96,7 @@ assetCtor(void * _this, va_list * params)
this->nmime_type = 0;
}
if (0 < this->size) {
this->data = mmap(
NULL, this->size, PROT_READ, MAP_PRIVATE, this->handle, 0);
@ -103,6 +104,7 @@ assetCtor(void * _this, va_list * params)
close(this->handle);
return -1;
}
}
this->ref_count = 1;

Loading…
Cancel
Save