- if (Chan->keyfile)
- fclose(Chan->keyfile);
- Chan->keyfile = KeyFile;
- Log(LOG_INFO|LOG_snotice,
- "New local channel key file for \"%s\" activated.", Chan->name);
-} /* Set_Key_File */
+ if (!array_copyb(&Chan->keyfile, KeyFile, len+1))
+ Log(LOG_WARNING,
+ "Could not set new channel key file \"%s\" for %s: %s",
+ KeyFile, Chan->name, strerror(errno));
+ else
+ Log(LOG_INFO|LOG_snotice,
+ "New local channel key file \"%s\" for %s activated.",
+ KeyFile, Chan->name);
+} /* Set_KeyFile */