VirtualBox

Changeset 76479 in vbox for trunk/src/VBox/ExtPacks


Ignore:
Timestamp:
Dec 26, 2018 2:00:32 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
127780
Message:

dt_lex.l: Recent GCC versions seem to take exception to strncpy, so use RTStrCopy for populating yyintsuffix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ExtPacks/VBoxDTrace/onnv/lib/libdtrace/common/dt_lex.l

    r76346 r76479  
    305305#ifdef VBOX
    306306                                int rc;
     307                                uint64_t uTmp = 0;
    307308#endif
    308309                                if (isdigit(v[0]))
     
    314315                                errno = 0;
    315316                                yylval.l_int = strtoull(v, &p, 0);
    316 #else
    317                                 {
    318                                    uint64_t uTmp = 0;
    319                                     rc = RTStrToUInt64Ex(v, &p, 0, &uTmp);
    320                                     yylval.l_int = uTmp;
    321                                 }
    322 #endif
    323317                                (void) strncpy(yyintsuffix, p,
    324318                                    sizeof (yyintsuffix));
    325319                                yyintdecimal = *v != '0';
    326 
    327 #ifndef VBOX
    328320                                if (errno == ERANGE)
    329321#else
     322                                rc = RTStrToUInt64Ex(v, &p, 0, &uTmp);
     323                                yylval.l_int = uTmp;
     324                                RTStrCopy(yyintsuffix, sizeof(yyintsuffix), p);
     325                                yyintdecimal = *v != '0';
    330326                                if (rc == VWRN_NUMBER_TOO_BIG || rc == VWRN_NEGATIVE_UNSIGNED)
    331327#endif
     
    407403                        errno = 0;
    408404                        yylval.l_int = strtoull(yytext, &p, 0);
     405                        yyintprefix = 0;
     406                        (void) strncpy(yyintsuffix, p, sizeof (yyintsuffix));
     407                        yyintdecimal = yytext[0] != '0';
     408                        if (errno == ERANGE)
    409409#else
    410410                        uint64_t uTmp = 0;
    411411                        int rc = RTStrToUInt64Ex(yytext, &p, 0, &uTmp);
    412412                        yylval.l_int = uTmp;
    413 #endif
    414413                        yyintprefix = 0;
    415                         (void) strncpy(yyintsuffix, p, sizeof (yyintsuffix));
     414                        RTStrCopy(yyintsuffix, sizeof(yyintsuffix), p);
    416415                        yyintdecimal = yytext[0] != '0';
    417 
    418 #ifndef VBOX
    419                         if (errno == ERANGE)
    420 #else
    421416                        if (rc == VWRN_NUMBER_TOO_BIG || rc == VWRN_NEGATIVE_UNSIGNED)
    422417#endif
Note: See TracChangeset for help on using the changeset viewer.

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