IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 26, 2008, 3:39:54 PM (18 years ago)
Author:
jhoblitt
Message:

consitently handle *_id fields as numeric values instead of converting back of forth between ints and strings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/pxregister.c

    r14023 r18336  
    2929#include "pxregister.h"
    3030
    31 bool pxnewExpSetState(pxConfig *config, const char *exp_id, const char *state)
     31bool pxnewExpSetState(pxConfig *config, psS64 exp_id, const char *state)
    3232{
    33     PS_ASSERT_PTR_NON_NULL(exp_id, false);
     33    if (!exp_id) {
     34        psError(PS_ERR_UNKNOWN, true, "0 is not a valid exp_id");
     35        return false;
     36    }
    3437    PS_ASSERT_PTR_NON_NULL(state, false);
    3538
     
    4649    }
    4750
    48     char *query = "UPDATE newExp SET state = '%s' WHERE exp_id = '%s'";
     51    char *query = "UPDATE newExp SET state = '%s' WHERE exp_id = %"PRId64;
    4952    if (!p_psDBRunQuery(config->dbh, query, state, exp_id)) {
    5053        psError(PS_ERR_UNKNOWN, false,
    51                 "failed to change state for exp_id %s", exp_id);
     54                "failed to change state for exp_id %"PRId64, exp_id);
    5255        return false;
    5356    }
Note: See TracChangeset for help on using the changeset viewer.