Traditional bugs

Bugs that most people may have noticed.

What you will see here:

  1. A Pascal CASE statement
  2. A C if statement

A Pascal CASE statement

This bug is Copyright (C) 1996 Ullrich von Bassewitz. You may use it in your own code without paying royalties if you attach a copyright notice to the file stating that I hold the copyright on this bug and that every occurance of this bug must have the copyright notice attached.

    case C of

      CmdToggleCompiler :
        Ss := CompilerList [CurrentCompiler].Shortname;

      CmdSetDefaultExtension :
        Ss := EdTruncateString (DefExtList, 13);

      CmdToggleBreakMode :
        if Curwin^.BM = DosMode then
          Ss := EdGetMessage (363);
          Ss := EdGetMessage (364);

This code compiled ok, but sometimes the screen output showed garbage instead a message. Using a debugger, I detected that the contents of the Ss string variable are not valid in any case. Do you know why?

A C if statement

This is one of my most recent creations. It is not as hard to detect as the bug above, but anyway, it is something, many people may have coded in some form or the other.

    if (sqlca.sqlcode == SQL_NULL_VALUE) {
        /* No old value */
        GNR_NB = 1;
    } if (sqlca.sqlcode < 0) {
        /* SQL error */
        SQLError ();
        goto ExitPoint;
    } else {
        /* No error, use the next value */

Go back.

sntradbugs.html; last change: 01-Aug-98