diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2012-02-14 13:55:52 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2012-02-14 13:55:52 +0100 |
commit | 36b1caedc259a041277651c5ce29107823745418 (patch) | |
tree | 01438b0d270427acbb763d860621e68d429364ba /svdrp.c | |
parent | 6715f4048407bb4db430f3181d29ee71a9069653 (diff) | |
download | vdr-36b1caedc259a041277651c5ce29107823745418.tar.gz vdr-36b1caedc259a041277651c5ce29107823745418.tar.bz2 |
Modified cSVDRP::CmdGRAB() to avoid writing into const data (backport from version 1.7.8)
Diffstat (limited to 'svdrp.c')
-rw-r--r-- | svdrp.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -10,7 +10,7 @@ * and interact with the Video Disk Recorder - or write a full featured * graphical interface that sits on top of an SVDRP connection. * - * $Id: svdrp.c 1.109.1.2 2012/02/14 13:52:35 kls Exp $ + * $Id: svdrp.c 1.109.1.3 2012/02/14 13:55:52 kls Exp $ */ #include "svdrp.h" @@ -803,9 +803,9 @@ void cSVDRP::CmdGRAB(const char *Option) FileName = s; } slash = strrchr(FileName, '/'); // there definitely is one - *slash = 0; - char *r = realpath(FileName, RealFileName); - *slash = '/'; + cString t(s); + t.Truncate(slash - FileName); + char *r = realpath(t, RealFileName); if (!r) { LOG_ERROR_STR(FileName); Reply(501, "Invalid file name \"%s\"", FileName); |