Browse Source

drillbit: strtol into a long int so negative responses properly get an error

Luke Dashjr 12 years ago
parent
commit
9878862aec
1 changed files with 1 additions and 1 deletions
  1. 1 1
      driver-drillbit.c

+ 1 - 1
driver-drillbit.c

@@ -628,7 +628,7 @@ char *drillbit_set_device(struct cgpu_info * const proc, char * const option, ch
 		// NOTE: Do not use replybuf in here without implementing it in drillbit_tui_handle_choice
 		// NOTE: Do not use replybuf in here without implementing it in drillbit_tui_handle_choice
 		const bool use_ext_clock = !(setting[0] == 'L');
 		const bool use_ext_clock = !(setting[0] == 'L');
 		char *end = &setting[use_ext_clock ? 0 : 1];
 		char *end = &setting[use_ext_clock ? 0 : 1];
-		const unsigned num = strtol(end, &end, 0);
+		const long int num = strtol(end, &end, 0);
 		const bool div2 = (end[0] == ':' && end[1] == '2');
 		const bool div2 = (end[0] == ':' && end[1] == '2');
 		// NOTE: board assignments are ordered such that it is safe to race
 		// NOTE: board assignments are ordered such that it is safe to race
 		if (use_ext_clock)
 		if (use_ext_clock)