Results 1 to 5 of 5

Thread: Waiting for new values sent by UDP in Qt

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Waiting for new values sent by UDP in Qt

    Your if condition is accessing uninitialized memory.
    Your memcpy does not check if buffer is 3*sizeof(double) long before accessing it.

    Your prev_a is a local variable, it is only valid to the end of the scope of your readyRead() function.
    If you want it to be persistent over multiple calls, you need to have it as a member of the class.

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    Damiann (25th May 2016)

Similar Threads

  1. Replies: 5
    Last Post: 27th November 2014, 10:15
  2. How to convert string hex values to its real binary values?
    By AttilaPethe in forum Qt Programming
    Replies: 1
    Last Post: 20th February 2012, 22:47
  3. Waiting WebKit
    By giusepped in forum Qt Programming
    Replies: 0
    Last Post: 13th May 2009, 03:40
  4. Waiting on a thread?
    By MrGarbage in forum Qt Programming
    Replies: 1
    Last Post: 3rd November 2007, 16:13
  5. Waiting for something
    By JonathanForQT4 in forum Newbie
    Replies: 20
    Last Post: 2nd May 2007, 17:35

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.