Skip to content
This repository was archived by the owner on Nov 23, 2022. It is now read-only.

Commit

Permalink
fix some compiler warnings
Browse files Browse the repository at this point in the history
Change-Id: I23c490e6228b0fcf656c76ac314c69508ba2329d
  • Loading branch information
that1 authored and Dees-Troy committed Nov 4, 2014
1 parent 78d0c5f commit d43bf2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ bool TWPartition::Find_Partition_Size(void) {
char label[32], device[32];
unsigned long size = 0;

sscanf(line, "%s %lx %*lx %*lu %s", label, &size, device);
sscanf(line, "%s %lx %*x %*u %s", label, &size, device);

// Skip header, annotation and blank lines
if ((strncmp(device, "/dev/", 5) != 0) || (strlen(line) < 8))
Expand Down Expand Up @@ -1391,13 +1391,13 @@ string TWPartition::Get_Restore_File_System(string restore_folder) {
first_period = Backup_FileName.find(".");
if (first_period == string::npos) {
LOGERR("Unable to find file system (first period).\n");
return false;
return string();
}
Restore_File_System = Backup_FileName.substr(first_period + 1, Backup_FileName.size() - first_period - 1);
second_period = Restore_File_System.find(".");
if (second_period == string::npos) {
LOGERR("Unable to find file system (second period).\n");
return false;
return string();
}
Restore_File_System.resize(second_period);
LOGINFO("Restore file system is: '%s'.\n", Restore_File_System.c_str());
Expand Down
2 changes: 1 addition & 1 deletion twrp-functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int TWFunc::Exec_Cmd(const string& cmd, string &result) {
memset(&buffer, 0, sizeof(buffer));
if (fgets(buffer, 128, exec) != NULL) {
buffer[128] = '\n';
buffer[129] = NULL;
buffer[129] = 0;
result += buffer;
}
}
Expand Down

0 comments on commit d43bf2d

Please sign in to comment.