【发布时间】:2014-05-11 15:15:01
【问题描述】:
我不明白为什么我会收到错误“围绕变量“tmp”的堆栈已损坏”。
我在不同的函数中使用相同的代码,它运行良好,但现在当函数“返回”时,它会抛出上述错误。
struct frame {
uint8_t dst[6];
uint8_t src[6];
};
//fill frame.dst || src exactly same way as code below without any errors or warnings
bool fcn() {
uint8_t tmp[6];
sscanf_s("00-00-00-00-00-00", "%x-%x-%x-%x-%x-%x", &tmp[0], &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5]);
//here I compare tmp[0] == frame.mac[0]...
return true;
} //here pops the error while debugging
我在程序的不同部分使用完全相同的代码,但没有任何错误。
【问题讨论】:
标签: c visual-studio-2010 scanf unsigned-integer