Minor tidyup in load_proc_partitions_info_cache()
Minor issues: 1) In the while loop reading from /proc/partitions into variable line, just after the sscanf() call the variable was re-purposed to hold the device name making the code unnecessarily hard to follow. 2) Variable c_str was a fixed sized buffer holding the device name read from /proc/partitions. 3) Variable c_str name provides no meaning as to what data it holds. 4) Return value from all the Utils::regexp_label() calls is converted from Glib::ustring to std::string to be stored in device variable. Resolve by using Utils::regexp_label() to extract the device name from each line in /proc/partitions and store in the variable device, already used for this purpose and now changed to type Glib::ustring.
parent
d04826cc
Please register or sign in to comment