mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-07-22 23:48:04 +02:00
2018-07-23 Fred Gleason <fredg@paravelsystems.com>
* Cleaned up RDConf calls to ensure UTF-8 compatibility.
This commit is contained in:
parent
58ca04ac61
commit
59c19a9e17
@ -17210,3 +17210,5 @@
|
|||||||
* Fixed a buffer overflow vulnerability in the 'RDCddbLookup' class.
|
* Fixed a buffer overflow vulnerability in the 'RDCddbLookup' class.
|
||||||
2018-07-23 Fred Gleason <fredg@paravelsystems.com>
|
2018-07-23 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Cleaned up CDDA calls to ensure UTF-8 compatibility.
|
* Cleaned up CDDA calls to ensure UTF-8 compatibility.
|
||||||
|
2018-07-23 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Cleaned up RDConf calls to ensure UTF-8 compatibility.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Small library for handling common configuration file tasks
|
// Small library for handling common configuration file tasks
|
||||||
//
|
//
|
||||||
// (C) Copyright 1996-2003 Fred Gleason <fredg@paravelsystems.com>
|
// (C) Copyright 1996-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// This program is free software; you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU Library General Public License
|
// it under the terms of the GNU Library General Public License
|
||||||
@ -500,8 +500,7 @@ QString RDGetDisplay(bool strip_point)
|
|||||||
int l;
|
int l;
|
||||||
|
|
||||||
if(getenv("DISPLAY")[0]==':') {
|
if(getenv("DISPLAY")[0]==':') {
|
||||||
display=QString().sprintf("%s%s",(const char *)RDGetHostAddr().toString(),
|
display=RDGetHostAddr().toString()+getenv("DISPLAY");
|
||||||
getenv("DISPLAY"));
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
display=QString(getenv("DISPLAY"));
|
display=QString(getenv("DISPLAY"));
|
||||||
@ -702,29 +701,30 @@ QString RDGetTimeLength(int mseconds,bool leadzero,bool tenths)
|
|||||||
tenthsecs=mseconds/100;
|
tenthsecs=mseconds/100;
|
||||||
if(leadzero) {
|
if(leadzero) {
|
||||||
if(tenths) {
|
if(tenths) {
|
||||||
return QString().sprintf("%s%d:%02d:%02d.%d",negative,hour,min,seconds,
|
return QString(negative)+
|
||||||
tenthsecs);
|
QString().sprintf("%d:%02d:%02d.%d",hour,min,seconds,tenthsecs);
|
||||||
}
|
}
|
||||||
return QString().sprintf("%s%d:%02d:%02d",negative,hour,min,seconds);
|
return QString(negative)+
|
||||||
|
QString().sprintf("%d:%02d:%02d",hour,min,seconds);
|
||||||
}
|
}
|
||||||
if((hour==0)&&(min==0)) {
|
if((hour==0)&&(min==0)) {
|
||||||
if(tenths) {
|
if(tenths) {
|
||||||
return QString().sprintf("%s:%02d.%d",negative,seconds,tenthsecs);
|
return QString(negative)+QString().sprintf(":%02d.%d",seconds,tenthsecs);
|
||||||
}
|
}
|
||||||
return QString().sprintf("%s:%02d",negative,seconds);
|
return QString(negative)+QString().sprintf(":%02d",seconds);
|
||||||
}
|
}
|
||||||
if(hour==0) {
|
if(hour==0) {
|
||||||
if(tenths) {
|
if(tenths) {
|
||||||
return QString().sprintf("%s%2d:%02d.%d",negative,min,seconds,
|
return QString(negative)+
|
||||||
tenthsecs);
|
QString().sprintf("%2d:%02d.%d",min,seconds,tenthsecs);
|
||||||
}
|
}
|
||||||
return QString().sprintf("%s%2d:%02d",negative,min,seconds);
|
return QString(negative)+QString().sprintf("%2d:%02d",min,seconds);
|
||||||
}
|
}
|
||||||
if(tenths) {
|
if(tenths) {
|
||||||
return QString().sprintf("%s%2d:%02d:%02d.%d",negative,hour,min,seconds,
|
return QString(negative)+
|
||||||
tenthsecs);
|
QString().sprintf("%2d:%02d:%02d.%d",hour,min,seconds,tenthsecs);
|
||||||
}
|
}
|
||||||
return QString().sprintf("%s%2d:%02d:%02d",negative,hour,min,seconds);
|
return QString(negative)+QString().sprintf("%2d:%02d:%02d",hour,min,seconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -848,9 +848,7 @@ bool RDWritePid(const QString &dirname,const QString &filename,int owner,
|
|||||||
{
|
{
|
||||||
FILE *file;
|
FILE *file;
|
||||||
mode_t prev_mask;
|
mode_t prev_mask;
|
||||||
QString pathname=QString().sprintf("%s/%s",
|
QString pathname=dirname+"/"+filename;
|
||||||
(const char *)dirname,
|
|
||||||
(const char *)filename);
|
|
||||||
|
|
||||||
prev_mask = umask(0113); // Set umask so pid files are user and group writable.
|
prev_mask = umask(0113); // Set umask so pid files are user and group writable.
|
||||||
file=fopen((const char *)pathname,"w");
|
file=fopen((const char *)pathname,"w");
|
||||||
@ -868,9 +866,7 @@ bool RDWritePid(const QString &dirname,const QString &filename,int owner,
|
|||||||
|
|
||||||
void RDDeletePid(const QString &dirname,const QString &filename)
|
void RDDeletePid(const QString &dirname,const QString &filename)
|
||||||
{
|
{
|
||||||
QString pid=QString().sprintf("%s/%s",
|
QString pid=dirname+"/"+filename;
|
||||||
(const char *)dirname,
|
|
||||||
(const char *)filename);
|
|
||||||
unlink((const char *)pid);
|
unlink((const char *)pid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user