change rev field in Signature to u32 and use strotoul to extract the value. Cleanup some dead code/comments

remotes/origin/master-1.1.x
Anoop Saldanha 14 years ago committed by Victor Julien
parent ed3b44b3b5
commit ba6bada155

@ -102,9 +102,8 @@ static int DetectPrioritySetup (DetectEngineCtx *de_ctx, Signature *s, char *raw
"to priority keyword");
goto error;
}
s->prio = prio;
/* if we have reached here, we have had a valid priority. Assign it */
//s->prio = atoi(prio_str);
s->prio = prio;
return 0;
error:

@ -53,16 +53,15 @@ static int DetectRevSetup (DetectEngineCtx *de_ctx, Signature *s, char *rawstr)
dubbed = 1;
}
long rev = 0;
unsigned long rev = 0;
char *endptr = NULL;
rev = strtol(rawstr, &endptr, 10);
rev = strtoul(rawstr, &endptr, 10);
if (endptr == NULL || *endptr != '\0') {
SCLogError(SC_ERR_INVALID_SIGNATURE, "Saw an invalid character as arg "
"to rev keyword");
goto error;
}
s->rev = rev;
//s->rev = (uint8_t)atoi(str);
if (dubbed)
SCFree(str);

@ -433,7 +433,7 @@ typedef struct Signature_ {
uint32_t id; /**< sid, set by the 'sid' rule keyword */
uint32_t gid; /**< generator id */
uint8_t rev;
uint32_t rev;
/** classification id **/
uint8_t class;

Loading…
Cancel
Save