~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbms/src/pbms.h

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 * are streaming enabled.
37
37
 *
38
38
 */
39
 
#pragma once
40
39
#ifndef __PBMS_H__
41
40
#define __PBMS_H__
42
41
 
162
161
        public:
163
162
        static bool couldBeURL(const char *blob_url, size_t size, MSBlobURLPtr blob)
164
163
        {
165
 
                if (blob_url && (size < PBMS_BLOB_URL_SIZE) && (size > 16)) {
 
164
                if (blob_url && (size < PBMS_BLOB_URL_SIZE)) {
166
165
                        MSBlobURLRec ignored_blob;
167
166
                        char    buffer[PBMS_BLOB_URL_SIZE+1];
168
167
                        char    junk[5];
172
171
                                blob = &ignored_blob;
173
172
                        
174
173
                        junk[0] = 0;
175
 
                        
176
 
                        // There is no guarantee that the URL will be null terminated
177
 
                        // so always copy it into our own buffer to be safe.
178
 
                        memcpy(buffer, blob_url, size);
179
 
                        buffer[size] = 0;
180
 
                        blob_url = buffer;
 
174
                        if (blob_url[size]) { // There is no guarantee that the URL will be null terminated.
 
175
                                memcpy(buffer, blob_url, size);
 
176
                                buffer[size] = 0;
 
177
                                blob_url = buffer;
 
178
                        }
181
179
                        
182
180
                        scanned = sscanf(blob_url, URL_FMT"%4s", 
183
181
                                &blob->bu_db_id,