Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Clever Code
  4. "edata" the hidden Microsoft variable

"edata" the hidden Microsoft variable

Scheduled Pinned Locked Moved Clever Code
helpdata-structuresdebuggingquestion
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SignalysisPhil
    wrote on last edited by
    #1

    Now this was a ways back, when DOS was the ruler and the Microsoft C compiler came on 5 1/4" floppies. These are the details as I remember them. We had a data acquisition application that used a data array called "edata". In one particular function where we had traced the bug, you could see that at the start of the fuction all was right with the data in the "edata" array. By the end of the function the data was corrupt. Should be a an easy find, right? The debugger clearly showed that that a call to sprintf() was the culprite. Again should be an easy find. We were not using "edata" in the call to sprintf() so it must have been a string overwrite into the "edata" variable. Two man weeks later we noticed in the LST files that sprintf() made reference to a variable called "edata". Apparently we had accidently stumbled across an undocumented Microsoft variable whose name space was mixed up with our own "edata". The fix? Changed our variable's name from "edata" to "afltEvenlySpacedData" and all was right with the world again. Since then I have never shortened a name for a variable even when my most famous variable became "pchGodOnlyKnows" (some bit flag in the nether regions that allowed me to change the read/write sector size for floppy disk IO functions, but I could never could find a document that said what exactly it was).

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups