]> Creatis software - gdcm.git/commitdiff
BUG: resultPath could be empty, cannot access char -1 in an array
authormalaterre <malaterre>
Fri, 12 May 2006 19:09:55 +0000 (19:09 +0000)
committermalaterre <malaterre>
Fri, 12 May 2006 19:09:55 +0000 (19:09 +0000)
src/gdcmDictSet.cxx
src/gdcmFile.h

index 6011c451bf33e12c5ed0fc895801da6b193beee5..218acc65b9b5c4195a73eb7bc0c808e5c9e3a45f 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDictSet.cxx,v $
   Language:  C++
-  Date:      $Date: 2006/05/11 15:23:07 $
-  Version:   $Revision: 1.76 $
+  Date:      $Date: 2006/05/12 19:09:55 $
+  Version:   $Revision: 1.77 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -142,7 +142,7 @@ std::string DictSet::BuildDictPath()
    {
       resultPath = PUB_DICT_PATH;
    }
-   if ( resultPath[resultPath.length()-1] != '/' )
+   if ( resultPath.length() && resultPath[resultPath.length()-1] != '/' )
    {
       resultPath += '/';
    }
index b3bb6aec37edb51588bd9ac1257165dedc629942..0eae98f22d514c8532dd87e6e9d1938a7471e870 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFile.h,v $
   Language:  C++
-  Date:      $Date: 2006/05/11 19:49:38 $
-  Version:   $Revision: 1.126 $
+  Date:      $Date: 2006/05/12 19:09:55 $
+  Version:   $Revision: 1.127 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -105,14 +105,14 @@ public:
 
    // Loading
    GDCM_LEGACY(bool Load( std::string const &filename ))
-   bool Load(); 
+   bool Load();
    // Standard values and informations contained in the header
    bool IsReadable();
-   
+
    void SetFourthDimensionLocation(uint16_t group, uint16_t elem) {
                    FourthDimensionLocation = TagKey(group, elem); }
 
-   // Some heuristic based accessors, end user intended 
+   // Some heuristic based accessors, end user intended
    int GetImageNumber();
    ModalityType GetModality();
 
@@ -120,7 +120,7 @@ public:
    int GetYSize();
    int GetZSize();
    int GetTSize(); // unnormalized in DICOM V3
-   
+
    float GetXSpacing();
    float GetYSpacing();
    float GetZSpacing();