Browse Source

opencl: Strip leading and trailing spaces from names

Luke Dashjr 12 years ago
parent
commit
357908080b
2 changed files with 3 additions and 2 deletions
  1. 2 1
      adl.c
  2. 1 1
      driver-opencl.c

+ 2 - 1
adl.c

@@ -387,7 +387,8 @@ void init_adl(int nDevs)
 		applog(LOG_INFO, "GPU %d %s hardware monitoring enabled", gpu, lpInfo[i].strAdapterName);
 		if (gpus[gpu].name)
 			free((void*)gpus[gpu].name);
-		gpus[gpu].name = lpInfo[i].strAdapterName;
+		if (lpInfo[i].strAdapterName)
+			gpus[gpu].name = trimmed_strdup(lpInfo[i].strAdapterName);
 		data->has_adl = true;
 		/* Flag adl as active if any card is successfully activated */
 		adl_active = true;

+ 1 - 1
driver-opencl.c

@@ -1469,7 +1469,7 @@ static bool opencl_thread_prepare(struct thr_info *thr)
 		return false;
 	}
 	if (!cgpu->name)
-		cgpu->name = strdup(name);
+		cgpu->name = trimmed_strdup(name);
 	if (!cgpu->kname)
 	{
 		switch (clStates[i]->chosen_kernel) {