c++ - Debug error R6010 -


i've searched online , none of helped me. code that's causing error: edited include more code. gives me r6010 debug error in visual studio 2013.

do {     rlength = recv(s1, rbuf, 1, 0);     if (rlength > 0)     {         rdata += rbuf[0];         if (rbuf[0] == nbyte[0])         {             switch (rdata[0])             {             case 'c':                 uid = rdata.substr(1, 3);                 statsend = "00" + uid + "st" + userinfo;                 charstat = statsend.c_str();                 llength = send(s1, charstat, strlen(charstat) + 1, 0);                 break;             case 'm':                 if (rdata[4] == 'c' && rdata[5] == 'h');                 {                     size_t start = 6;                     size_t end = rdata.find("!@#$!@#&!@#*lll");                     size_t start2 = rdata.find("*lll");                     size_t end2 = rdata.find(";");                      cout << rdata.substr(start2, end2 - start2) << ":" << rdata.substr(start, end - start) << endl;                 }                 break;             }             rdata = "";         }     } } while (rlength > 0); 

this guess can infer code. when call

rdata.find("!@#$!@#&!@#*lll");  

...but doesn't find substring, variable start set random value. (in test program huge integer.)

then later try use (undefined) value stored in start parse through string again.

i suspect that's you're seeing... "out-of-bounds" error. see this question.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -