]> the.earth.li Git - onak.git/blobdiff - sixdegrees.c
Bump debhelper compat level to 13
[onak.git] / sixdegrees.c
index a842230c4c9bbc808754410e3908d19a57c23169..f7f15200dd0d7b424276e10f9dd90ceb2c02b301 100644 (file)
@@ -13,8 +13,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <getopt.h>
@@ -119,7 +118,7 @@ void sixdegrees(struct onak_dbctx *dbctx, uint64_t keyid)
         * if it's signed by the key we're looking at.
         */
        initcolour(false);
-       degree = countdegree(dbctx, keyinfo, true, 7);
+       countdegree(dbctx, keyinfo, true, 7);
 
        puts("\t\tSigned by\t\tSigns");
        for (loop = 1; loop < 7; loop++) {
@@ -137,12 +136,15 @@ int main(int argc, char *argv[])
 {
        int optchar;
        char *configfile = NULL;
-       uint64_t keyid = 0x2DA8B985;
+       uint64_t keyid = 0x94FA372B2DA8B985;
        struct onak_dbctx *dbctx;
 
        while ((optchar = getopt(argc, argv, "c:")) != -1 ) {
                switch (optchar) {
                case 'c':
+                       if (configfile != NULL) {
+                               free(configfile);
+                       }
                        configfile = strdup(optarg);
                        break;
                }
@@ -153,11 +155,12 @@ int main(int argc, char *argv[])
        }
 
        readconfig(configfile);
+       free(configfile);
        initlogthing("sixdegrees", config.logfile);
-       dbctx = config.dbinit(true);
+       dbctx = config.dbinit(config.backend, true);
        if (dbctx != NULL) {
                inithash();
-               sixdegrees(dbctx, dbctx->getfullkeyid(dbctx, keyid));
+               sixdegrees(dbctx, keyid);
                destroyhash();
                dbctx->cleanupdb(dbctx);
        } else {