Use const char foo[] over const char *foo for string literals

Saves one pointer in memory and is cleaner than const char * const.
This commit is contained in:
Tor Arne Vestbø
2012-10-03 21:30:53 +02:00
parent 7a58f90043
commit c9e2a8ed53

View File

@@ -16,7 +16,7 @@
using namespace std;
static const char *image_path = "/sparsebundle.dmg";
static const char image_path[] = "/sparsebundle.dmg";
struct sparsebundle_data {
char *path;
@@ -202,7 +202,7 @@ int main(int argc, char **argv)
string key, line;
while (getline(plist_data, line)) {
static const char *whitespace_chars = " \n\r\t";
static const char whitespace_chars[] = " \n\r\t";
line.erase(0, line.find_first_not_of(whitespace_chars));
line.erase(line.find_last_not_of(whitespace_chars) + 1);