void dbg_add_modes(const char *modes) { char env[256]; char *name; strncpy(env, modes, sizeof(env)); for (name = strtok(env,","); name; name = strtok(NULL, ",")) dbg_add_mode(name); }
/** * Cycles through each comma-delimited debugging option and * adds it to the debugging modes by calling dbg_add_mode */ void dbg_add_modes(const char *modes) { char env[256]; char *name; strncpy(env, modes, sizeof(env)); /* Maybe it would be good if we did this without strtok, but I'm too lazy */ for (name = strtok(env, ","); name; name = strtok(NULL, ",")) dbg_add_mode(name); }