Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-103490

QString asprintf behaved differently with printf

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.15.2, 6.2.4, 6.3.0
    • Core: I/O
    • None

    Description

      the code is like this:

        setbuf( stdout, NULL );
        qDebug() << QString().asprintf( "msg is \"%s\"", "test" );
        printf( "msg is \"%s\"", "test" ); 
      

      qDebug()<< QString().asprintf( "msg is \"%s\"", "test" );

      the expected result is :

      msg is "test"
      

      but the actual result is:

      "msg is \"test\""
      

      the output string in the console should not contain escape character \.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            xiaoyifang yifang xiao
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes