Convert sizeof foo to sizeof(foo).
[tinc] / src / gcrypt / rsa.c
index 11d452c..d354b0c 100644 (file)
@@ -1,6 +1,6 @@
 /*
     rsa.c -- RSA key handling
-    Copyright (C) 2007 Guus Sliepen <guus@tinc-vpn.org>
+    Copyright (C) 2007-2012 Guus Sliepen <guus@tinc-vpn.org>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -61,7 +61,7 @@ static bool pem_decode(FILE *fp, const char *header, uint8_t *buf, size_t size,
        size_t i, j = 0;
 
        while(!feof(fp)) {
-               if(!fgets(line, sizeof line, fp))
+               if(!fgets(line, sizeof(line), fp))
                        return false;
 
                if(!decode && !strncmp(line, "-----BEGIN ", 11)) {
@@ -148,7 +148,7 @@ static size_t ber_read_len(unsigned char **p, size_t *buflen) {
                return *(*p)++;
        }
 }
-       
+
 
 static bool ber_read_sequence(unsigned char **p, size_t *buflen, size_t *result) {
        int tag = ber_read_id(p, buflen);
@@ -173,7 +173,7 @@ static bool ber_read_mpi(unsigned char **p, size_t *buflen, gcry_mpi_t *mpi) {
 
        if(mpi)
                err = gcry_mpi_scan(mpi, GCRYMPI_FMT_USG, *p, len, NULL);
-       
+
        *p += len;
        *buflen -= len;
 
@@ -215,7 +215,7 @@ bool rsa_read_pem_public_key(rsa_t *rsa, FILE *fp) {
        uint8_t derbuf[8096], *derp = derbuf;
        size_t derlen;
 
-       if(!pem_decode(fp, "RSA PUBLIC KEY", derbuf, sizeof derbuf, &derlen)) {
+       if(!pem_decode(fp, "RSA PUBLIC KEY", derbuf, sizeof(derbuf), &derlen)) {
                logger(DEBUG_ALWAYS, LOG_ERR, "Unable to read RSA public key: %s", strerror(errno));
                return NULL;
        }
@@ -235,7 +235,7 @@ bool rsa_read_pem_private_key(rsa_t *rsa, FILE *fp) {
        uint8_t derbuf[8096], *derp = derbuf;
        size_t derlen;
 
-       if(!pem_decode(fp, "RSA PRIVATE KEY", derbuf, sizeof derbuf, &derlen)) {
+       if(!pem_decode(fp, "RSA PRIVATE KEY", derbuf, sizeof(derbuf), &derlen)) {
                logger(DEBUG_ALWAYS, LOG_ERR, "Unable to read RSA private key: %s", strerror(errno));
                return NULL;
        }