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

QString asprintf behaved differently with printf

XMLWordPrintable

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

      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 \.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes