summaryrefslogtreecommitdiffstats
path: root/adbbu/twadbstream.h
diff options
context:
space:
mode:
authorAyke van Laethem <aykevanlaethem@gmail.com>2017-06-02 00:19:27 +0200
committerAyke van Laethem <aykevanlaethem@gmail.com>2017-06-03 02:37:06 +0200
commit05c2de4c688ef34c80dc6df249acf0e661d5f23d (patch)
treeac7fca531c3964f350176460f00eb0d32ca98e31 /adbbu/twadbstream.h
parentcryptfs: Remove dm-crypt device on failed table load (diff)
downloadandroid_bootable_recovery-05c2de4c688ef34c80dc6df249acf0e661d5f23d.tar
android_bootable_recovery-05c2de4c688ef34c80dc6df249acf0e661d5f23d.tar.gz
android_bootable_recovery-05c2de4c688ef34c80dc6df249acf0e661d5f23d.tar.bz2
android_bootable_recovery-05c2de4c688ef34c80dc6df249acf0e661d5f23d.tar.lz
android_bootable_recovery-05c2de4c688ef34c80dc6df249acf0e661d5f23d.tar.xz
android_bootable_recovery-05c2de4c688ef34c80dc6df249acf0e661d5f23d.tar.zst
android_bootable_recovery-05c2de4c688ef34c80dc6df249acf0e661d5f23d.zip
Diffstat (limited to 'adbbu/twadbstream.h')
-rw-r--r--adbbu/twadbstream.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/adbbu/twadbstream.h b/adbbu/twadbstream.h
index 23d4a1fea..5fa6bde5d 100644
--- a/adbbu/twadbstream.h
+++ b/adbbu/twadbstream.h
@@ -65,6 +65,11 @@ struct AdbBackupControlType {
char type[16]; //stores the type of command, TWENDADB, TWCNT, TWEOF, TWMD5, TWDATA and TWERROR
uint32_t crc; //stores the zlib 32 bit crc of the AdbBackupControlType struct to allow for making sure we are processing metadata
char space[484]; //stores space to align the struct to 512 bytes
+
+ //return a C++ string while not reading outside the type char array
+ std::string get_type() {
+ return std::string(type, strnlen(type, sizeof(type)-1));
+ }
};
//general info for file metadata stored in adb backup header