Const-correctness: rpmCharCheck() doesn't modify field, make it const
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 29 Oct 2010 17:30:07 +0000 (20:30 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 29 Oct 2010 17:30:07 +0000 (20:30 +0300)
build/parsePreamble.c
build/rpmbuild_internal.h

index f96713e..053e3ed 100644 (file)
@@ -600,9 +600,9 @@ if (multiToken) { \
  * @param whitelist    string of permitted characters
  * @return             RPMRC_OK if OK
  */
-rpmRC rpmCharCheck(rpmSpec spec, char *field, size_t fsize, const char *whitelist)
+rpmRC rpmCharCheck(rpmSpec spec, const char *field, size_t fsize, const char *whitelist)
 {
-    char *ch, *stop = &field[fsize];
+    const char *ch, *stop = &field[fsize];
 
     for (ch=field; *ch && ch < stop; ch++) {
        if (risalnum(*ch) || strchr(whitelist, *ch)) continue;
index f0b2e46..492c4de 100644 (file)
@@ -263,7 +263,7 @@ int parseScript(rpmSpec spec, int parsePart);
  * @return              RPMRC_OK if OK
  */
 RPM_GNUC_INTERNAL
-rpmRC rpmCharCheck(rpmSpec spec, char *field, size_t fsize, const char *whitelist);
+rpmRC rpmCharCheck(rpmSpec spec, const char *field, size_t fsize, const char *whitelist);
 
 /** \ingroup rpmbuild
  * Parse dependency relations from spec file and/or autogenerated output buffer.