All pastes #418843 Raw Edit

Stuff

public text v1 · immutable
#418843 ·published 2007-03-31 21:25 UTC
rendered paste body
#include <stdlib.h> 
#include <stdio.h>
#include <string.h>
#include "contact.h"

int get_return_code(char* computer_uuid, char* product_id) {
    char hex_computer_uuid[16];
    char hex_product_id[8];
    char command_line[80];
    snprintf(hex_computer_uuid, 16, "%02hx%02hx%02hx%02hx%02hx%02hx%02hx%02hx", 
            computer_uuid[0], computer_uuid[1], computer_uuid[2], computer_uuid[3],
            computer_uuid[4], computer_uuid[5], computer_uuid[6], computer_uuid[7]);
    snprintf(hex_product_id, 8, "\n%02hx%02hx%02hx%02hx", 
            product_id[0], product_id[1], product_id[2], product_id[3]);

    printf("\n%s\n%s\n", hex_computer_uuid, hex_product_id);
    snprintf(command_line, 80, "./verify %s %s", hex_computer_uuid, hex_product_id);
    return system(command_line);
}