functionSource
stringlengths
20
97.4k
CWE-119
bool
2 classes
CWE-120
bool
2 classes
CWE-469
bool
2 classes
CWE-476
bool
2 classes
CWE-other
bool
2 classes
combine
int64
0
1
zsize(ZVALUE z) { /* ignore the size of 0, 1 and -1 */ if (z.v != _zeroval_ && z.v != _oneval_ && !zisunit(z) && !ziszero(z)) { return z.len * sizeof(HALF); } else { return (size_t)0; } }
false
false
false
false
false
0
WriteHeader (HPDF_FontDef fontdef, HPDF_Stream stream, HPDF_UINT32 *check_sum_ptr) { HPDF_TTFontDefAttr attr = (HPDF_TTFontDefAttr)fontdef->attr; HPDF_STATUS ret = HPDF_OK; HPDF_PTRACE ((" WriteHeader\n")); ret += HPDF_Stream_Write (stream, attr->header.version_number,...
false
false
false
false
false
0
_gda_mysql_meta_indexes_tab (G_GNUC_UNUSED GdaServerProvider *prov, GdaConnection *cnc, GdaMetaStore *store, GdaMetaContext *context, GError **error, G_GNUC_UNUSED const GValue *table_catalog, const GValue *table_schema, const GValue *table_name, const GValue *index_name_n) { GdaDataModel *mode...
false
false
false
false
false
0
sinfo_utl_ima_line_corr( cpl_parameterlist * parlist, cpl_frameset * framelist) { cpl_parameter * p= NULL ; int kappa=18; int filt_rad=3; int width=4; cpl_image * ima=NULL ; cpl_image * ima_out=NULL ; ...
false
false
false
false
false
0
AddCommand(const cec_command &command) { // don't forward the standby opcode more than once every 10 seconds if (command.opcode == CEC_OPCODE_STANDBY) { CLockObject lock(m_mutex); if (m_iPreventForwardingPowerOffCommand != 0 && m_iPreventForwardingPowerOffCommand > GetTimeMs()) return; e...
false
false
false
false
false
0
xml_node_new(const gchar *name) { XmlNode *node; if((node = g_malloc(sizeof *node)) != NULL) { if(name != NULL) g_strlcpy(node->name, name, sizeof node->name); else node->name[0] = '\0'; node->data.type = XVT_NONE; node->children = NULL; } return node; }
false
false
false
false
false
0
OnMessage(talk_base::Message* pmsg) { if (pmsg->message_id == MSG_CREATE_TUNNEL) { ASSERT(session_manager_->signaling_thread()->IsCurrent()); CreateTunnelData* data = static_cast<CreateTunnelData*>(pmsg->pdata); Session* session = session_manager_->CreateSession(jid_.Str(), namespace_); TunnelSession*...
false
false
false
false
false
0
clone() const { // get sub-class to return a cloned object BaseDim* o = clone_impl(); // fill in operator for cloned object o->d_operator = d_operator; // now clone any attached operand dimension if (d_operand) o->d_operand = d_operand->clone(); ...
false
false
false
false
false
0
mgsl_wait_until_sent(struct tty_struct *tty, int timeout) { struct mgsl_struct * info = tty->driver_data; unsigned long orig_jiffies, char_time; if (!info ) return; if (debug_level >= DEBUG_LEVEL_INFO) printk("%s(%d):mgsl_wait_until_sent(%s) entry\n", __FILE__,__LINE__, info->device_name ); if (mg...
false
false
false
false
false
0
colorshifts() { int i; int mask[3]; int l, c; mask[0] = x_vis->red_mask; mask[1] = x_vis->green_mask; mask[2] = x_vis->blue_mask; for (i = 0; i < 3; i++) { for (l = 0; l < 32 && !((1<<l) & mask[i]); l++); for (c = 0; l+c < 32 && ((1<<(l+c)) & mask[i]); c++); fb.cc[i].l = l; fb.cc[i].r = 8-c; } }
false
false
false
false
false
0
deal_damage(tenm_object *my, tenm_object *your, int n) { /* sanity check */ if (my == NULL) { fprintf(stderr, "deal_damage: my is NULL\n"); return 0; } if (your == NULL) { fprintf(stderr, "deal_damage: your is NULL\n"); return 0; } if ((n < 0) || (n >= my->n)) { fprintf(stderr, "de...
false
false
false
false
false
0
ajByteRevShort(ajshort* sval) { union lbytes { char chars[8]; short s; } data, revdata; char* cs; char* cd; ajuint i; data.s = *sval; cs = data.chars; cd = &revdata.chars[sizeof(ajshort)-1]; for(i=0; i < sizeof(ajshort); i++) { *cd = *cs++; ...
false
false
false
false
false
0
ppp_decompress_frame(struct ppp *ppp, struct sk_buff *skb) { int proto = PPP_PROTO(skb); struct sk_buff *ns; int len; /* Until we fix all the decompressor's need to make sure * data portion is linear. */ if (!pskb_may_pull(skb, skb->len)) goto err; if (proto == PPP_COMP) { int obuff_size; switch(ppp-...
false
false
false
false
false
0
do_pvchange_uuid (const char *device) { CLEANUP_FREE char *err = NULL; int r; r = command (NULL, &err, str_lvm, "pvchange", "-u", device, NULL); if (r == -1) { reply_with_error ("%s: %s", device, err); return -1; } udev_settle (); return 0; }
false
false
false
false
false
0
_dispatch(omniCallHandle& _handle) { const char* op = _handle.operation_name(); if( omni::strMatch(op, "get_data") ) { _0RL_cd_5290a8c8f297bdd2_c0000000 _call_desc(_0RL_lcfn_5290a8c8f297bdd2_01000000, "get_data", 9, 1); _handle.upcall(this,_call_desc); return 1; } if( omni::strMatch(op, "set...
false
false
false
false
false
0
ptrobj_bang(t_ptrobj *x) { t_symbol *templatesym; int n; t_typedout *to; if (!gpointer_check(&x->x_gp, 1)) { pd_error(x, "ptrobj_bang: empty pointer"); return; } templatesym = gpointer_gettemplatesym(&x->x_gp); for (n = x->x_ntypedout, to = x->x_typedout; n--; to++) {...
false
false
false
false
false
0
cs_GetLastError(CompressedStream *cs) { if (!cs->errmsg[0]) return NULL; return cs->errmsg; }
false
false
false
false
false
0
rewriteURLCompile(const char *urlfmt) { rewritetoken *head = NULL; rewritetoken **tail = &head; rewritetoken *_new = NULL; const char *stt = urlfmt; debug(85, 3) ("rewriteURLCompile(%s)\n", urlfmt); while (*urlfmt != '\0') { int urlEncode = 0; while (*urlfmt != '\0' && *urlfmt != '%') ++u...
true
true
false
true
false
1
netio_desc_create_udp(char *nio_name,int local_port, char *remote_host,int remote_port) { netio_inet_desc_t *nid; netio_desc_t *nio; if (!(nio = netio_create(nio_name))) return NULL; nid = &nio->u.nid; nid->local_port = local_port; nid->remote_port = rem...
false
false
false
false
false
0
lpfc_max_vpi_show(struct device *dev, struct device_attribute *attr, char *buf) { struct Scsi_Host *shost = class_to_shost(dev); struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; struct lpfc_hba *phba = vport->phba; uint32_t cnt; if (lpfc_get_hba_info(phba, NULL, NULL, NULL, NULL, &cnt, NUL...
false
false
false
false
false
0
Process_v9_option_data(exporter_v9_domain_t *exporter, void *data_flowset, FlowSource_t *fs) { option_offset_t *offset_table; uint32_t id, size_left; uint8_t *in; id = GET_FLOWSET_ID(data_flowset); offset_table = fs->option_offset_table; while ( offset_table && offset_table->id != id ) offset_table = offset_ta...
false
false
false
false
false
0
iconsel_release_event(GtkWidget *widget, GdkEventButton *event, icon_selection_t *iconsel) { gint x, y; g_assert(widget != NULL && iconsel != NULL && event != NULL); TRACE("%s", ""); x = (int) (event->x / 48); y = (int) (event->y /...
false
false
false
false
false
0
xps_open_device(gx_device *dev) { gx_device_vector *const vdev = (gx_device_vector*)dev; gx_device_xps *const xps = (gx_device_xps*)dev; int code = 0; vdev->v_memory = dev->memory; vdev->vec_procs = &xps_vector_procs; gdev_vector_init(vdev); code = gdev_vector_open_file_options(vdev, 512, ...
false
false
false
false
false
0
gatt_connect(const gchar *src, const gchar *dst, const gchar *dst_type, const gchar *sec_level, int psm, int mtu, BtIOConnect connect_cb) { GIOChannel *chan; bdaddr_t sba, dba; uint8_t dest_type; GError *err = NULL; BtIOSecLevel sec; /* Remote device */ if (dst == NULL) { g_printerr("Remote Bluetooth ...
false
false
false
false
false
0
kalmia_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) { struct sk_buff *skb2 = NULL; u16 content_len; unsigned char *header_start; unsigned char ether_type_1, ether_type_2; u8 remainder, padlen = 0; if (!skb_cloned(skb)) { int headroom = skb_headroom(skb); int tailroom = skb_tailroom(skb); ...
false
false
false
false
false
0
puturl(char *s, int size, MMIOT *f, int display) { unsigned char c; while ( size-- > 0 ) { c = *s++; if ( c == '\\' && size-- > 0 ) { c = *s++; if ( !( ispunct(c) || isspace(c) ) ) Qchar('\\', f); } if ( c == '&' ) Qstring("&amp;", f); else if ( c == '<' ) Qstring("&lt;", f); el...
false
false
false
false
false
0
chunkData(uint i) { if(i >= chunkCount()) return ByteVector::null; // Offset for the first subchunk's data long begin = 12 + 8; for(uint it = 0; it < i; it++) begin += 8 + d->chunks[it].size + d->chunks[it].padding; seek(begin); return readBlock(d->chunks[i].size); }
false
false
false
false
false
0
typeChkExp(Exref_t * ref, Exid_t * sym) { tctype ty; if (ref) { ty = typeChk(0, ref->symbol); for (ref = ref->next; ty && ref; ref = ref->next) ty = typeChk(ty, ref->symbol); if (!ty) return 0; } else ty = 0; return typeChk(ty, sym); }
false
false
false
false
false
0
operator+=( int64_t aValue ) { if ((aValue % 2) > 0) { __sync_xor_and_fetch(&_value, 0x01); } return *this; }
false
false
false
false
false
0
alsa_mixer_simple_init(snd_mixer_class_t *class) { struct bclass_base_ops *ops; int err; err = mixer_simple_basic_dlopen(class, &ops); if (err < 0) return 0; err = ops->selreg(class, selectors, SELECTORS); if (err < 0) return err; err = ops->sidreg(class, sids, SELECTORS); if (err < 0) return err; retu...
false
false
false
false
false
0
highlight_color(id, what, modec) int id; char_u *what; /* "font", "fg", "bg", "sp", "fg#", "bg#" or "sp#" */ int modec; /* 'g' for GUI, 'c' for cterm, 't' for term */ { static char_u name[20]; int n; int fg = FALSE; int sp = FALSE; int font = FALSE; if (id <= 0 || id > hig...
false
false
false
false
false
0
ide_get_identity_ioctl(ide_drive_t *drive, unsigned int cmd, unsigned long arg) { u16 *id = NULL; int size = (cmd == HDIO_GET_IDENTITY) ? (ATA_ID_WORDS * 2) : 142; int rc = 0; if ((drive->dev_flags & IDE_DFLAG_ID_READ) == 0) { rc = -ENOMSG; goto out; } /* ata_id_to_hd_driveid() relies on 'id' to be fu...
false
true
false
false
false
1
gf_w128_bytwo_p_multiply(gf_t *gf, gf_val_128_t a128, gf_val_128_t b128, gf_val_128_t c128) { uint64_t amask[2], pmask, pp, prod[2]; /*John: pmask is always the highest bit set, and the rest zeros. amask changes, it's a countdown.*/ uint64_t topbit; /* this is used as a boolean value */ gf_internal_t *h; h = (...
false
false
false
false
false
0
Ketje_UnwrapCiphertext(Ketje_Instance *instance, const unsigned char *ciphertext, unsigned char *plaintext, unsigned int dataSizeInBytes) { unsigned int size; unsigned char temp; if ( (instance->phase & Ketje_Phase_FeedingAssociatedData) != 0) { Ket_Step( instance->state, instance->dataRemainderSize, FRAMEBITS01...
false
false
false
false
false
0
find_char(char const* text, char c) { for(;*text; ++text) if (c == *text) return true; return false; }
false
false
false
false
false
0
os_file_status( /*===========*/ const char* path, /*!< in: pathname of the file */ ibool* exists, /*!< out: TRUE if file exists */ os_file_type_t* type) /*!< out: type of the file (if it exists) */ { #ifdef __WIN__ int ret; struct _stat statinfo; ret = _stat(path, &statinfo); if (ret && (errno == ENOENT || er...
false
false
false
false
false
0
airo_networks_initialize(struct airo_info *ai) { int i; INIT_LIST_HEAD(&ai->network_free_list); INIT_LIST_HEAD(&ai->network_list); for (i = 0; i < AIRO_MAX_NETWORK_COUNT; i++) list_add_tail(&ai->networks[i].list, &ai->network_free_list); }
false
true
false
false
false
1
send2child(struct tcp_connection* tcpconn) { int i; int min_busy; int idx; min_busy=tcp_children[0].busy; idx=0; for (i=0; i<tcp_children_no; i++){ if (!tcp_children[i].busy){ idx=i; min_busy=0; break; }else if (min_busy>tcp_children[i].busy){ min_busy=tcp_children[i].busy; idx=i; } } t...
false
false
false
false
false
0
dns_timer_expired ( struct retry_timer *timer, int fail ) { struct dns_request *dns = container_of ( timer, struct dns_request, timer ); if ( fail ) { dns_done ( dns, -ETIMEDOUT ); } else { dns_send_packet ( dns ); } }
false
false
false
false
false
0
battery_nth(gint n, gboolean create) { Battery *bat; if (n > 10) return NULL; if (n < 0) { if (!composite_battery && create) { bat = g_new0(Battery, 1); battery_list = g_list_prepend(battery_list, bat); bat->id = GKRELLM_BATTERY_COMPOSITE_ID; /* -1 */ composite_battery = bat; gkrellm_ale...
false
false
false
false
false
0
buildin_successrefitem(struct script_state *st) { int num, i = -1; struct map_session_data *sd; num=conv_num(st,& (st->stack->stack_data[st->start+2])); sd=script_rid2sd(st); if(num > 0 && num <= EQUIP_INDEX_MAX) i=pc_checkequip(sd,equip_pos[num-1]); if(i >= 0) { int ep=sd->status.inventory[i].equip; pc_u...
false
false
false
false
false
0
ganv_canvas_clear(GanvCanvas* canvas) { canvas->impl->_selected_items.clear(); canvas->impl->_selected_edges.clear(); Items items = canvas->impl->_items; // copy FOREACH_ITEM(items, i) { gtk_object_destroy(GTK_OBJECT(*i)); } canvas->impl->_items.clear(); GanvCanvasImpl::Edges edges = canvas->impl->_edges; //...
false
false
false
false
false
0
outer_xref(void) {shift(); while(next_control<format) if(next_control!=begin_comment)C_xref(false); else {boolean one_liner=loc[-1]=='/';int bal=0; typedef_tracking(false); while((next_control=scan_comment(&bal,one_liner))=='|') {C_xref(true);if(next_control!='|')break;} typedef_tracking(true); } }
false
false
false
false
true
1
aic26_probe(struct snd_soc_codec *codec) { struct aic26 *aic26 = dev_get_drvdata(codec->dev); int ret, reg; aic26->codec = codec; /* Reset the codec to power on defaults */ snd_soc_write(codec, AIC26_REG_RESET, 0xBB00); /* Power up CODEC */ snd_soc_write(codec, AIC26_REG_POWER_CTRL, 0); /* Audio Control 3 (...
false
false
false
false
false
0
put_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels, int line_size) { int i; uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; /* read the pixels */ for(i=0;i<8;i++) { pixels[0] = cm[block[0]]; pixels[1] = cm[block[1]]; pixels[2] = cm[bloc...
false
false
false
false
false
0
getPoint(double f) const { if (direction.length()==0) { return direction; } return origin+direction*f; }
false
false
false
false
false
0
virtio_gpu_ttm_bo_destroy(struct ttm_buffer_object *tbo) { struct virtio_gpu_object *bo; struct virtio_gpu_device *vgdev; bo = container_of(tbo, struct virtio_gpu_object, tbo); vgdev = (struct virtio_gpu_device *)bo->gem_base.dev->dev_private; if (bo->hw_res_handle) virtio_gpu_cmd_unref_resource(vgdev, bo->hw_...
false
false
false
false
false
0
vm_executable_path() { char* path = new char[PATH_MAX + 1]; int size = readlink("/proc/self/exe", path, PATH_MAX); if (size < 0) { fatal_error("Cannot read /proc/self/exe", 0); return NULL; }
false
false
false
false
false
0
do_if(void) { int label_l = ++label_counter; int label_e; while (lookahead != '(') next_token(); next_token(); outstr("{\n"); outstr("if (!("); parse_until(UNTIL_CLOSEPAREN); outstr(")\n"); fprintf(output_file, "goto %s%d;\n", opt_prefix_arg, label_l); parse_until(UNTIL_ENDOFINSTR); while (isspace(look...
false
false
false
false
false
0
sub_call(int idx, double *pval, char **pstr, int *npm, int *otyp) throw(ParserError) { // Save current return value int save_return_type = return_type; double save_return_value = return_value; if (return_type == 2) { // Efficiency of this will be improved if RefCount objects are introduced // see glearray.cpp (...
false
false
false
true
false
1
grep_cache(struct grep_opt *opt, const char **paths, int cached) { int hit = 0; int nr; read_cache(); for (nr = 0; nr < active_nr; nr++) { struct cache_entry *ce = active_cache[nr]; if (!S_ISREG(ce->ce_mode)) continue; if (!pathspec_matches(paths, ce->name, opt->max_depth)) continue; /* * If CE_VA...
false
false
false
false
false
0
dm_command( const int starting_point ) { static FOUR_BYTE start; FOUR_BYTE finish; if ( starting_point != -1 ) start = starting_point; finish = start + 128; // can wrap around 64K start &= memory_mask; finish &= memory_mask; while ( start != finish ) { cout <<...
false
false
false
false
false
0
decodeMsg(SPtr<TSrvIfaceIface> ptrIface, SPtr<TIPv6Addr> peer, char * buf, int bufsize) { int ifaceid = ptrIface->getID(); if (bufsize<4) return 0; switch (buf[0]) { case SOLICIT_MSG: return new TSrvMsgSolicit(ifaceid, peer, buf, bufsize); case REQUEST_MSG: retu...
false
false
false
false
false
0
efi_snp_driver_stop ( EFI_DRIVER_BINDING_PROTOCOL *driver, EFI_HANDLE device, UINTN num_children, EFI_HANDLE *children ) { EFI_BOOT_SERVICES *bs = efi_systab->BootServices; struct efi_snp_device *snpdev; DBGCP ( driver, "SNPDRV %p DRIVER_STOP %p (%ld %p)\n", driver, device, ( ( unsigned lo...
false
false
false
false
false
0
expand_domainname(char target[64], const char* source, int slen) { if (slen>64) return 0; if (source[slen-1]=='.') { strncpy(target, source, slen-1); target[slen-1] = '\0'; return 1; } strncpy(target, source, slen); target[slen] = '\0'; if (zone.domainname[0]) { if (zone.domainname[0]!='.') strcat(ta...
false
false
false
false
false
0
new_optab () { int i; optab op = (optab) ggc_alloc (sizeof (struct optab)); for (i = 0; i < NUM_MACHINE_MODES; i++) { op->handlers[i].insn_code = CODE_FOR_nothing; op->handlers[i].libfunc = 0; } return op; }
false
false
false
false
false
0
ACL_INTCacheCheck(int which, char *uri, ACLListHandle_t **acllistp) { PLHashTable *hash; PR_ASSERT(uri && acl_uri_hash && acl_uri_get_hash); /* ACL cache: If the ACL List is already in the cache, there's no need * to go through the pathcheck directives. * NULL means that the URI hasn't been a...
false
false
false
false
false
0
filter181(int16_t *data, int width, int height, int stride){ int x,y; /* horizontal filter */ for(y=1; y<height-1; y++){ int prev_dc= data[0 + y*stride]; for(x=1; x<width-1; x++){ int dc; dc= - prev_dc + data[x + y*stride]*8 - da...
false
false
false
false
false
0
crccheck_show(struct device *dev, struct device_attribute *attr, char *buf) { if (put_user(w1_enable_crccheck + 0x30, buf)) return -EFAULT; return sizeof(w1_enable_crccheck); }
false
false
false
false
false
0
restore_cpu_finish (void) { init_m68k (); m68k_setpc (regs.pc); doint (); fill_prefetch_quick (); set_cycles (start_cycles); events_schedule (); if (regs.stopped) set_special (SPCFLAG_STOP); //activate_debugger (); }
false
false
false
false
false
0
KeccakP200_StatePermute(void *state, unsigned int nr) { displayStateAsBytes(1, "Input of permutation", (const unsigned char *)state); for(nr=nrRounds-nr; nr<nrRounds; nr++) KeccakF200Round(state, nr); displayStateAsBytes(1, "State after permutation", (const unsigned char *)state); }
false
false
false
false
false
0
pipe_toggle_save(struct r8a66597 *r8a66597, struct r8a66597_pipe *pipe, struct urb *urb) { if (r8a66597_read(r8a66597, pipe->pipectr) & SQMON) pipe_toggle_set(r8a66597, pipe, urb, 1); else pipe_toggle_set(r8a66597, pipe, urb, 0); }
false
false
false
false
false
0
match(const char *s, const char *key) { for (; toupper(*key) == *s || tolower(*key) == *s; s++, key++) { if (*s == '\0') return 1; } return 0; }
false
false
false
false
false
0
fw_major_num(const char *fw_ver) { int fw_major = 0, i; i = sscanf(fw_ver, "%d.", &fw_major); if (i != 1) return 0; return fw_major; }
false
false
false
false
false
0
probe_memory_block_size(void) { /* start from 2g */ unsigned long bz = 1UL<<31; if (totalram_pages >= (64ULL << (30 - PAGE_SHIFT))) { pr_info("Using 2GB memory block size for large-memory system\n"); return 2UL * 1024 * 1024 * 1024; } /* less than 64g installed */ if ((max_pfn << PAGE_SHIFT) < (16UL << 32))...
false
false
false
false
false
0
completedReply(const AHCommand& c, const XData& d) { AHCommand r(c.node(), d, c.sessionId()); r.setStatus(Completed); return r; }
false
false
false
false
false
0
g_tls_database_gnutls_pkcs11_lookup_certificates_issued_by (GTlsDatabase *database, GByteArray *issuer_subject, GTlsInteraction *interaction, ...
false
false
false
false
false
0
on_background_button_press (GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gpointer data) { GooCanvas *canvas; GList *items, *elem; g_print ("Button Press Item: %p\n", target); canvas = goo_canvas_item_get_canvas (item); items = goo_canvas_get_items_at (canvas, event...
false
false
false
false
false
0
dapm_supply_check_power(struct snd_soc_dapm_widget *w) { struct snd_soc_dapm_path *path; DAPM_UPDATE_STAT(w, power_checks); /* Check if one of our outputs is connected */ snd_soc_dapm_widget_for_each_sink_path(w, path) { DAPM_UPDATE_STAT(w, neighbour_checks); if (path->weak) continue; if (path->connect...
false
false
false
false
false
0
plist_data_hash(gconstpointer key) { plist_data_t data = plist_get_data((plist_t) key); guint hash = data->type; guint i = 0; char *buff = NULL; guint size = 0; switch (data->type) { case PLIST_BOOLEAN: case PLIST_UINT: case PLIST_REAL: buff = (char *) &data->intval; /...
false
false
false
false
false
0
rePeek(ReCompiled *p){ return p->sIn.i<p->sIn.mx ? p->sIn.z[p->sIn.i] : 0; }
false
false
false
false
false
0
reset() { for (int i=0; i<mat.size(); i++) { dFree (mat[i]->data,mat[i]->size); dFree (mat[i],sizeof(dMatInfo)); } mat.setSize (0); afterfirst = 0; index = 0; }
false
false
false
false
false
0
wordsplit_c_unquote_copy (char *dst, const char *src, size_t n) { int i = 0; int c; while (i < n) { if (src[i] == '\\') { ++i; if (src[i] == 'x' || src[i] == 'X') { if (n - i < 2) { *dst++ = '\\'; *dst++ = src[i++]; } else { int off = xtonum (&c, src + i + 1,...
false
false
false
false
false
0
sony_nc_sysfs_show(struct device *dev, struct device_attribute *attr, char *buffer) { int value, ret = 0; struct sony_nc_value *item = container_of(attr, struct sony_nc_value, devattr); if (!*item->acpiget) return -EIO; ret = sony_nc_int_call(sony_nc_acpi_handle, *item->acpiget, NULL, &value);...
false
false
false
false
false
0
open_cb() { FileDialog dlg(_("Please select a file for editing."), FILE_OPEN, -1, _conf, _encodings); if (dlg.run()) { int enc = dlg.encoding(); std::vector<std::string> files = dlg.get(); for (unsigned int x = 0; x < files.size(); x++) { create_document(files[x], enc); } } }
false
false
false
false
false
0
atl1_alloc_rx_buffers(struct atl1_adapter *adapter) { struct atl1_rfd_ring *rfd_ring = &adapter->rfd_ring; struct pci_dev *pdev = adapter->pdev; struct page *page; unsigned long offset; struct atl1_buffer *buffer_info, *next_info; struct sk_buff *skb; u16 num_alloc = 0; u16 rfd_next_to_use, next_next; struct r...
false
false
false
false
false
0
wayland_drm_buffer_get(struct wl_drm *drm, struct wl_resource *resource) { if (resource == NULL) return NULL; if (wl_resource_instance_of(resource, &wl_buffer_interface, &drm->buffer_interface)) return wl_resource_get_user_data(resource); else return NULL; }
false
false
false
false
false
0
PlaceWidget(double bds[6]) { int i; double bounds[6], center[3]; this->AdjustBounds(bds,bounds,center); this->Points->SetPoint(0, bounds[0], bounds[2], bounds[4]); this->Points->SetPoint(1, bounds[1], bounds[2], bounds[4]); this->Points->SetPoint(2, bounds[1], bounds[3], bounds[4]); this->Points->Se...
false
false
false
false
false
0
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, struct ctf_scanner *scanner, yyscan_t yyscanner) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep, scanner, yyscanner) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; struct ctf_scanner *scanner; yy...
false
false
false
false
false
0
cson_output_indent( cson_data_dest_f f, void * state, unsigned char blanks, unsigned int depth ) { if( 0 == blanks ) return 0; else { #if 0 /* FIXME: stuff the indention into the buffer and make a single call to f(). */ enum { BufLen = 200 };...
false
false
false
false
false
0
CAFOpenArtRead(const char *path, ARTNUM art, size_t *len) { CAFHEADER head; int fd; CAFTOCENT tocent; struct stat st; if ( (fd = open(path, O_RDONLY)) < 0) { /* ** if ENOENT (not there), just call this "article not found", ** otherwise it's a more serious error and stash the errno. */ if (errn...
false
false
false
false
true
1
is_iso646_name( const char *zName, /* file path */ int nName /* path length */ ){ int i; for(i = 0; i < nName; i++){ unsigned char c = (unsigned char)zName[i]; if( c>0x7e ) return 0; } return 1; }
false
false
false
false
false
0
_e_wid_signal_cb1(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) { Evas_Object *wid; wid = data; if ((!wid) || (e_widget_disabled_get(wid))) return; e_widget_focus_steal(wid); e_widget_change(wid); _e_wid_activate_hook(wid); }
false
false
false
false
false
0
complete_cmd_desc(const wcstring &str) { ASSERT_IS_MAIN_THREAD(); const wchar_t *cmd_start; int skip; const wchar_t * const cmd = str.c_str(); cmd_start=wcsrchr(cmd, L'/'); if (cmd_start) cmd_start++; else cmd_start = cmd; /* Using apropos with a single-characte...
false
false
false
false
false
0
grib2GetLevel(grib_handle *gh, int *leveltype, int *lbounds, int *level1, int *level2, int *level_sf, int *level_unit) { int status; int leveltype2 = -1; long lpar; long factor; *leveltype = 0; *lbounds = 0; *level1 = 0; *level2 = 0; *level_sf = 0; *level_unit = 0; status = grib_ge...
false
false
false
false
false
0
bc_read(int fh, block_cache *bc, uint8_t *buf, off_t offset, size_t len) { off_t blockid = offset & ~CACHE_BLOCK_MASK; off_t off_in_block = offset & CACHE_BLOCK_MASK; if ( len + off_in_block > CACHE_BLOCK_SIZE ) { // read is too big for one block, do it in chunks. ssize_t ret = 0; ...
false
false
false
false
false
0
squashfs_read_table(struct super_block *sb, u64 block, int length) { int pages = (length + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; int i, res; void *table, *buffer, **data; struct squashfs_page_actor *actor; table = buffer = kmalloc(length, GFP_KERNEL); if (table == NULL) return ERR_PTR(-ENOMEM); data = kc...
false
false
false
false
false
0
strext(char *fn, char *ext) { char *p, *q; if ((p = strrchr(fn, DIRSEP)) == 0) p = fn; if ((q = strrchr(p, '.')) == 0) strcat(p, "."); else q[1] = '\0'; strcat(p, ext); }
false
false
false
false
false
0
lmlm4_read_header(AVFormatContext *s, AVFormatParameters *ap) { AVStream *st; if (!(st = av_new_stream(s, 0))) return AVERROR(ENOMEM); st->codec->codec_type = CODEC_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_MPEG4; st->need_parsing = AVSTREAM_PARSE_HEADERS; av_set_pts_info(st, 64...
false
false
false
false
false
0
do_qt_text(s) char *s; { if (!in_msg) { Fprintf(stderr, TEXT_NOT_IN_MSG, qt_line); } curr_msg->size += strlen(s); return; }
false
false
false
false
false
0
on_leave_page(guint uiPageNumber) { //Call base class: //NotebookNoFrame::on_leave_page(uiPageNumber); //Tell the page to save itself: if(!m_destructor_in_progress) { Gtk::Widget* pChild = get_nth_page(uiPageNumber); if(pChild) { Base_DB* pBox = dynamic_cast<Base_DB*>(pChild); if(pBo...
false
false
false
false
false
0
TwoPhaseShmemInit(void) { bool found; TwoPhaseState = ShmemInitStruct("Prepared Transaction Table", TwoPhaseShmemSize(), &found); if (!IsUnderPostmaster) { GlobalTransaction gxacts; int i; Assert(!found); TwoPhaseState->freeGXacts = NULL; TwoPhaseState->numPrepXacts = 0; /* * ...
false
false
false
false
false
0
next_iface(struct iface_info *info, int *err, struct iface_conf_list *ifaces) { size_t sa_len = 0; if (ifaces->next == NULL) { *err = 0; return 0; } if (strlen(ifaces->next->ifa_name) >= sizeof(info->name)) { log_error("Interface name '%s' too long", ifaces->next->ifa_name); *err = 1; return 0; } ...
false
true
false
false
false
1
camel_nntp_store_has_capabilities (CamelNNTPStore *nntp_store, CamelNNTPCapabilities caps) { gboolean result; g_return_val_if_fail (CAMEL_IS_NNTP_STORE (nntp_store), FALSE); g_mutex_lock (&nntp_store->priv->property_lock); result = ((nntp_store->priv->capabilities & caps) == ca...
false
false
false
false
false
0
write_real_program (const definition * def) { version_list *vp; proc_list *proc; decl_list *l; if (!newstyle) return; /* not needed for old style */ for (vp = def->def.pr.versions; vp != NULL; vp = vp->next) { for (proc = vp->procs; proc != NULL; proc = proc->next) { fprintf (fout, "\n");...
false
false
false
false
false
0
GIT_CONFIG_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params) { static GObject *instance = NULL; if (G_LIKELY (NULL != instance)) return g_object_ref (instance); instance = G_OBJECT_CLASS (giggle_git_config_parent_class)-> cons...
false
false
false
false
false
0
bCheckBytes(FILE *pFile, const UCHAR *aucBytes, size_t tBytes) { int iIndex, iChar; fail(pFile == NULL || aucBytes == NULL || tBytes == 0); rewind(pFile); for (iIndex = 0; iIndex < (int)tBytes; iIndex++) { iChar = getc(pFile); if (iChar == EOF || iChar != (int)aucBytes[iIndex]) { NO_DBG_HEX(iChar); NO_...
false
false
false
false
false
0
wmem_test_allocator_callbacks(void) { wmem_allocator_t *allocator; gboolean t = TRUE; gboolean f = FALSE; guint cb_id; allocator = wmem_allocator_new(WMEM_ALLOCATOR_STRICT); expected_allocator = allocator; wmem_register_callback(expected_allocator, &wmem_test_cb, &f); wmem_register...
false
false
false
false
false
0
eval_value(char *pcToken, list_t *list_values) { int r; size_t len; char *value; char *amp; /* <string>foobar</string> * 012345678 : 8 is the first string character index */ /* calculate the argument length */ for (len=0; pcToken[len+8] != '<'; len++) ; len++; /* final NULL byte */ value = malloc(len); ...
false
false
false
false
false
0
rtnl_rtntype_n2a(int id, char *buf, int len) { switch (id) { case RTN_UNSPEC: return "none"; case RTN_UNICAST: return "unicast"; case RTN_LOCAL: return "local"; case RTN_BROADCAST: return "broadcast"; case RTN_ANYCAST: return "anycast"; case RTN_MULTICAST: return "multicast"; case RTN_BLACKHOLE: r...
false
false
false
false
false
0