mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-10-16 18:56:56 +02:00
Make setprogname and getprogname arguments and return value const
This is more correct as the strings are not going to be changed, and it matches the function signatures on other BSDs. Suggested-by: Aurelien Jarno <aurel32@debian.org>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright © 2006 Robert Millan
|
||||
* Copyright © 2010 Guillem Jover
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -30,16 +31,16 @@
|
||||
|
||||
#include <bsd/stdlib.h>
|
||||
|
||||
static char *__progname = NULL;
|
||||
static const char *__progname = NULL;
|
||||
|
||||
char *
|
||||
getprogname()
|
||||
const char *
|
||||
getprogname(void)
|
||||
{
|
||||
return __progname;
|
||||
}
|
||||
|
||||
void
|
||||
setprogname(char *new)
|
||||
setprogname(const char *new)
|
||||
{
|
||||
__progname = new;
|
||||
}
|
||||
|
Reference in New Issue
Block a user