Changeset 996 for cpp/frams


Ignore:
Timestamp:
07/09/20 17:26:44 (4 years ago)
Author:
Maciej Komosinski
Message:

Added helpful stdout messages before crash for cases when assert() would not work/print anything

Location:
cpp/frams/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/util/sstring-simple.cpp

    r989 r996  
    8080                if (newlength >= allocated)
    8181                {
     82                        logMessage("SString", "endWrite", LOG_CRITICAL, "newlength >= allocated");
    8283                        assert(newlength < allocated);
    8384                        if (allocated == 0) return;
     
    286287                        }
    287288                        n = strlen(buf); //pretend vsnprintf() or vsprintf() was OK to exit the endless loop
    288                 }
     289        }
    289290#endif
    290291
     
    301302#endif
    302303                        size *= 2;  /* twice the old size */
    303         }
     304                }
    304305}
    305306
  • cpp/frams/util/sstring.cpp

    r989 r996  
    226226                if ((newlength >= (buf->size + 1)) || (buf->size == 0))
    227227                {
     228                        logMessage("SString", "endWrite", LOG_CRITICAL, "newlength >= allocated or nothing allocated");
    228229                        assert((newlength < (buf->size + 1)) && (buf->size > 0));
    229230                        if (buf->size == 0) return;
Note: See TracChangeset for help on using the changeset viewer.