Jump to content

A file size check stumbling at 112 bytes


temnix

Recommended Posts

Posted

While doing the usual "sanity check" for GLOBbing SPL files, I was thrown off by an SPL called CDDETECT.SPL. It's not a real spell, it has no abilities or global effects. Its size, therefore, is exactly 112 bytes, so it should have been bypassed by SOURCE_SIZE > 112. In fact, though, it kept bucking the installation until I added an exception for it. That nipped it, but I don't want to patch things blindly, to be surprised by any other pseudospells that might happen in some installation. There is another SPL that I routinely exclude by name, by the way, in case a mod is installed on Icewind Dale: #BONECIR. I don't remember if the problem there is the same as here or not. But I would like to know why this 112-byte stops the SOURCE_SIZE > 112 check?

Posted

Probably looking at "show offsets" in NI or something. The last field in CDDETECT.SPL is at byte 112... but it is a two-byte field. That's why every file size sanity check I've ever seen people do in Weidu checks for (%SOURCE_SIZE% > 0x71), i.e. (%SOURCE_SIZE% >= 114).

Posted

Also, source size checks aren't needed any more regardless. Before we had stuff like IF_EXISTS we had to specify files on an ALLOW_MISSING list, which WeiDU treated as existent, 0-byte files. The SOURCE_SIZE check was meant to skip those files in a C_E(_R), not as any kind of real validity check.

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...