fix possibly uninitialized variable warning
authorTom Henderson <tomh@tomh.org>
Fri, 30 Jan 2015 11:34:38 -0800
changeset 11188 e010083f6592
parent 11187 597e36a6eb28
child 11189 c17091a7616e
fix possibly uninitialized variable warning
src/wifi/model/mac-low.cc
--- a/src/wifi/model/mac-low.cc	Fri Jan 30 15:04:08 2015 -0500
+++ b/src/wifi/model/mac-low.cc	Fri Jan 30 11:34:38 2015 -0800
@@ -2246,10 +2246,11 @@
       uint16_t endSequence = ((*it).second.first.GetStartingSequence () + 2047) % 4096;
       uint16_t mappedStart = QosUtilsMapSeqControlToUniqueInteger (seq, endSequence);
       BufferedPacketI last = (*it).second.second.begin ();
-      uint16_t guard;
+      uint16_t guard = 0;
       if (last != (*it).second.second.end ())
-        guard = (*it).second.second.begin ()->second.GetSequenceControl () & 0xfff0;
-
+        {
+          guard = (*it).second.second.begin ()->second.GetSequenceControl () & 0xfff0;
+        }
       BufferedPacketI i = (*it).second.second.begin ();
       for (; i != (*it).second.second.end ()
            && QosUtilsMapSeqControlToUniqueInteger ((*i).second.GetSequenceNumber (), endSequence) < mappedStart;)