Procházet zdrojové kódy

Use character arrays instead of pointers for constant strings

Guillem Jover před 17 roky
rodič
revize
378737d036
3 změnil soubory, kde provedl 3 přidání a 3 odebrání
  1. 1 1
      dpkg-deb/build.c
  2. 1 1
      lib/dpkg/parsehelp.c
  3. 1 1
      src/configure.c

+ 1 - 1
dpkg-deb/build.c

@@ -74,7 +74,7 @@ static const char *arbitrary_fields[] = {
   NULL
 };
 
-static const char *private_prefix = "Private-";
+static const char private_prefix[] = "Private-";
 
 static int known_arbitrary_field(const struct arbitraryfield *field) {
   const char **known;

+ 1 - 1
lib/dpkg/parsehelp.c

@@ -266,7 +266,7 @@ parse_ensure_have_field(struct parsedb_state *ps,
                         const struct pkginfo *pigp,
                         const char **value, const char *what)
 {
-  static const char *empty = "";
+  static const char empty[] = "";
 
   if (!*value) {
     parse_warn(ps, pigp, _("missing %s"), what);

+ 1 - 1
src/configure.c

@@ -94,7 +94,7 @@ void deferred_configure(struct pkginfo *pkg) {
 	char *currenthash = NULL, *newdisthash = NULL;
 	struct stat stab;
 	enum conffopt what;
-	static const char *EMPTY_HASH = "-";
+	static const char EMPTY_HASH[] = "-";
 
 	if (pkg->status == stat_notinstalled)
 		ohshit(_("no package named `%s' is installed, cannot configure"),pkg->name);