VirtualBox

Changeset 73071 in vbox for trunk/src/libs/xpcom18a4/nsprpub


Ignore:
Timestamp:
Jul 11, 2018 4:02:23 PM (6 years ago)
Author:
vboxsync
Message:

xpcom: fix thinko in PR_LogPrint. Harmless in practice since the bug
affected only XP_MAC (i.e. ancient MacOS, not OS X).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/io/prlog.c

    r46593 r73071  
    527527
    528528    nb += PR_vsnprintf(line+nb, sizeof(line)-nb-1, fmt, ap);
    529     if (nb && (line[nb-1] != '\n')) {
     529    if (nb > 0) {
     530        if (line[nb-1] != '\n') {
    530531#ifndef XP_MAC
    531         line[nb++] = '\n';
    532 #else
    533         line[nb++] = '\015';
    534 #endif
    535         line[nb] = '\0';
    536     } else {
     532            line[nb++] = '\n';
     533#else
     534            line[nb++] = '\015';
     535#endif
     536            line[nb] = '\0';
     537        } else {
    537538#ifdef XP_MAC
    538         line[nb-1] = '\015';
    539 #endif
     539            line[nb-1] = '\015';
     540#endif
     541        }
    540542    }
    541543    va_end(ap);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette