Skip to content

shared-qmi: fix potentially uninitialized 'mcc' variable

Ben Chan requested to merge benchan/ModemManager:fix-shared-qmi into master

mm-shared-qmi.c:358:9: error: variable 'mcc' is used uninitialized whenever '&&' condition is false [-Werror,-Wsometimes-uninitialized] if (operator_id && !mm_3gpp_parse_operator_id (operator_id, &mcc, &mnc, &error)) { ^~~~~~~~~~~ mm-shared-qmi.c:367:9: note: uninitialized use occurs here if (mcc) { ^~~ mm-shared-qmi.c:358:9: note: remove the '&&' if its condition is always true if (operator_id && !mm_3gpp_parse_operator_id (operator_id, &mcc, &mnc, &error)) { ^~~~~~~~~~~~~~ mm-shared-qmi.c:339:51: note: initialize the variable 'mcc' to silence this warning guint16 mcc; ^ = 0

Merge request reports